How to write python program in windows command prompt

After you have installed python in your computer, you can either use NetBeans 8.1 or Eclipse or any other IDE to write the python script then run it. However, for some of you who do not have any IDE installed on your computer then you might want to consider using the windows command prompt which is also good for writing simple python program if you know how to use it.

With Python installed on your pc lets open up the command prompt, then type in python to start the python shell, then from there you can start to type in the python script then run the program.

Lets write a simple python script to sort a list as follow, you will need to press the enter key each time you have completed a line.

windows command prompt
windows command prompt

The script above will sort the data in ascending order.

As you see we can use windows command prompt to write and run the python script easily, but for the complicated program which requires us to debug and change the script rapidly then we will need to use the real IDE such as NetBeans or Eclipse.