Debugging with PyCharm terminal arguments

2019-02-01 18:19发布

I have been using PyCharm for a bit so I am not an expert.

How I normally ran my programs was with the terminal like so:

program.py -t input1 -t1 input2

I was wondering how can I debug this?

For other programs I wrote, I did not have any arguments so debugging was simply setting break points and pressing debug.

2条回答
霸刀☆藐视天下
2楼-- · 2019-02-01 18:47

It was almost correct but just needed little correction with full script path.

Menu: Run->Edit configurations->"+" (add new config)->Python.

Script name: path + /program.py

Script params: -t input1 -t1 input2

查看更多
聊天终结者
3楼-- · 2019-02-01 19:01

Menu: Run -> Edit configurations -> "+" (add new config) -> Python.

Script name: program.py

Script params: -t input1 -t1 input2

查看更多
登录 后发表回答