Running Python in PowerShell?

Running Python in PowerShell?

Since, you are able to run Python in PowerShell. You can just do python <scriptName>.py to run the script. So, for a script named containing

name = raw_input(Enter your name: )
print Hello,  + name

The PowerShell session would be

PS C:Python27> python
Enter your name: Monty Python
Hello, Monty Python
PS C:Python27>

As far as I have understood your question, you have listed two issues.


You are not able to execute the Python scripts by double clicking the Python file in Windows.


The script runs too fast to be seen by the human eye.


Add input() in the bottom of your script and then try executing it with double click. Now the cmd will be open until you close it.


print(Hello World)


./ issue


Use Tab to autocomplete the filenames rather than manually typing the filename with ./ autocomplete automatically fills all this for you.


CD into the directory in which .py files are present and then assume the filename is then type python te and then press Tab, it will be automatically converted to python ./

Running Python in PowerShell?

Go to Control PanelSystem and SecuritySystem, and then click Advanced system settings on the left hand side menu.

On the Advanced tab, click Environment Variables.

Under User variables append the PATH variable with path to your Python install directory:


Leave a Reply

Your email address will not be published. Required fields are marked *