chaquo / chaquopy

Chaquopy: the Python SDK for Android
https://chaquo.com/chaquopy/
MIT License
807 stars 132 forks source link

how should I do to see log printed By python's print() function and error message #1100

Closed ghshgd closed 7 months ago

ghshgd commented 7 months ago

description is same with title. I tried a lot of challenge to see log printed By print function. but I can't, below is how I try In powershell, adb logcat adb logcat -s E/Python(the reason why I try this code is chatGPT say running this code to see error log) npx react-native log-android except for this, I tried a lot of challenge, but I can't. if there is person who know how to do this, let me know for me to thank you

mhsmith commented 7 months ago

Instructions for viewing the Android logs are here. The tags to search for are python.stdout and python.stderr.

ghshgd commented 7 months ago

@mhsmith thank you for letting me know. now that now is rate(it's dawn in my country), after trying that during the daytime today , I'll give you a feedback. thank you

ghshgd commented 7 months ago

@mhsmith hi, I've tried adb logcat -s python.stdout but nothing happened(my print() function is not showed up) and tried adb logcat -s python.stderr, below is happened --------- beginning of main 02-28 00:58:41.565 5140 5140 W python.stderr: ./java/android/importer.py:634: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html is this right?

mhsmith commented 7 months ago

You're obviously seeing some of the stderr, so possible explanations are:

Since I don't know anything about your code, I can't guess which of these is more likely.

I recommend you use Android Studio to view the logs, it will be much more convenient than the command line adb tool.

ghshgd commented 7 months ago

@mhsmith Hi, Thank you, When print function is on the top, rightly called, the problem has solved, Thank you again and I'll close this report