Close

Python – run python scripts

You have to do this from the powershell command line:

Announcement

I have released my new course on Udemy, Kubernetes By Example. Sign up now to get free lifetime access!

 

  1. user powershell to cd to the directory containin the py file.
  2. from the powershell command line type “python {script-name}.py”

 

to load From within python, check out:

 

http://stackoverflow.com/questions/436198/what-is-an-alternative-to-execfile-in-python-3-0

This link says you need to navigate to the python script directory using powershell, start terminal session, then do:

exec(open("./pythonscript.py").read())