I have this simple python code saved in my desktop in the folder named as "Python".
You can see I run the file named "Running_from_cmd.py" from the command prompt. And it shows the correct output. What if I want to pass the input from cmd and the cmd or the IDE shows the output. So for that we have to pass the arguments to the same command line as shown below:
The code in the IDE should be this:
argv stands for Argument values and here I have passed the index value of 1 because index value 0 indicates the file name which is Running_from_cmd.py
in the command line. 6 is the index value 1 and 4 is the index value 2. The same value passes to the IDE and the output is shown accordingly.