Debugging with PyCharm terminal arguments

PythonPycharm

Python Problem Overview


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.

Python Solutions


Solution 1 - Python

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

Script name: program.py

If you need to debug a script from installed packages, such as tox, you can specify the full path too. For example: Script name: /home/your_user/.envs/env_name/bin/tox

Above /home/your_user/.envs/env_name is a path to virtual environment containing tox package.

Script params: -t input1 -t1 input2

Solution 2 - Python

Just the image wise representation of answer

step 1: Click on the Run menu click Edit configuration

enter image description here

  1. Select + in top right corner and select python

enter image description here

  1. Provide the name ,absolutepath of the script/ select the script by clicking three dots(green marker , script paramters and python interpreter

enter image description here

Solution 3 - Python

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLiondancerView Question on Stackoverflow
Solution 1 - PythonAndrew_LvovView Answer on Stackoverflow
Solution 2 - PythonJebaseelan RaviView Answer on Stackoverflow
Solution 3 - PythonArjunMView Answer on Stackoverflow