Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the stdout/stderr content of the Python script? #142

Open
cosven opened this issue Feb 22, 2025 · 4 comments
Open

How to get the stdout/stderr content of the Python script? #142

cosven opened this issue Feb 22, 2025 · 4 comments

Comments

@cosven
Copy link

cosven commented Feb 22, 2025

I run the flask_example in local environment.
There is a print statement in the python script

print("Trying to run a socket server on:", port)

However, I can't see the output of the script.


I have a Python service and it use Python logging module to log some info/warning/errors.
While using serious_python, I found no way to check the log. Can you help me?

@NiuXiaoGuang
Copy link

请教一下您是如何设置export SERIOUS_PYTHON_SITE_PACKAGES=$(pwd)/build/site-packages的,是在flutter项目中设置的吗

@cosven
Copy link
Author

cosven commented Feb 23, 2025

请教一下您是如何设置export SERIOUS_PYTHON_SITE_PACKAGES=$(pwd)/build/site-packages的,是在flutter项目中设置的吗

不是的,直接在命令上设置的。主要是打包 app.zip 的时候需要这个东西。


No. Set this env var in a terminal, not in the flutter project. For example

# First step
export SERIOUS_PYTHON_SITE_PACKAGES=$(pwd)/build/site-packages
# Second step
dart run serious_python:main package -p Android app/src -r 'feeluown==4.1.10' --verbose

@twkevinzhang
Copy link

i have same question.

@cosven
Copy link
Author

cosven commented Feb 24, 2025

i have same question.

I found a workaround. Setup the logging output to a file in your Python application. And use adb shell (while developing an Android application) to check the file content.

Tips: Since adb shell has no command like vim/emacs/less. You can use toybox vi YOUR_LOGGING_FILE to see the whole content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants