简体   繁体   中英

How to debug python programs with shell scripts in PyCharm?

How to debug python programs with shell scripts in PyCharm?

I have a shell script which starts a PyCharm program as below test.sh:

python scripts/recognition.py @scripts/options/with_bert.opt

Then at command line I run:

sh test.sh

I set the debugger break point even in the first 'import' line of recognition.py, it still doesn't stop when it's run in PyCharm.

Is there a way to debug python in PyCharm when it is started in a shell script?

The debugging method is to parse out the parameters and environment variables that passed into Python file from shell scripts, and then add them to the run/debug configuration of the Python file in pycharm, or change and add them to the python file directly.

enter image description here

For more details, one can refer to enter link description here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM