public class AndroidPlatform extends Python.Platform
Constructor and Description |
---|
AndroidPlatform(Context context)
Uses the
Application context of the given context to initialize
Python. |
Modifier and Type | Method and Description |
---|---|
Application |
getApplication()
Returns the Application context of the context which was passed to the contructor.
|
String |
getPath()
Returns the value to assign to
PYTHONPATH , or null to leave it
unset. |
void |
onStart(Python py)
Called after Python is started.
|
void |
redirectStdioToLogcat()
Redirects the native stdout and stderr streams to Logcat.
|
public AndroidPlatform(@NotNull Context context)
Application
context of the given context to initialize
Python.@NotNull public Application getApplication()
@NotNull public String getPath()
Python.Platform
PYTHONPATH
, or null
to leave it
unset. The default implementation returns null
.getPath
in class Python.Platform
public void onStart(@NotNull Python py)
Python.Platform
onStart
in class Python.Platform
public void redirectStdioToLogcat()
Redirects the native stdout and stderr streams to Logcat. They will appear with
the tags native.stdout
and native.stderr
respectively. This may be
useful for debugging the Python startup process, or seeing messages produced by
non-Python libraries.
This method has no effect on stdin. It also has no effect on Python's sys.stdout
and sys.stderr
, which are always redirected as described here.