Mar-02-2017, 02:27 PM
(This post was last modified: Mar-02-2017, 02:27 PM by sparkz_alot.)
I really wish Python would make the default location "C:\Python36" it would make life so much simpler.
Any who, a couple of things. When you save a file, such as your "hello.py", it will be saved in your current directory (unless you specifically tell it different), so if you are in "C:\ " that is where it will be saved. If you are currently in "C:\PythonPractice" that is where it will be saved. If you can't remember where it was saved, use the File Manager and search for "hello.py" (no doubt there will only be one listing :-) ). Now you have a choice, run it from it's current location or move it to your PythonPractice folder. In either case, once you open your cmd window, you need to change to that directory, for example, from the command line, type:
In short, do not use "py hello.py", just "hello.py"
Any who, a couple of things. When you save a file, such as your "hello.py", it will be saved in your current directory (unless you specifically tell it different), so if you are in "C:\ " that is where it will be saved. If you are currently in "C:\PythonPractice" that is where it will be saved. If you can't remember where it was saved, use the File Manager and search for "hello.py" (no doubt there will only be one listing :-) ). Now you have a choice, run it from it's current location or move it to your PythonPractice folder. In either case, once you open your cmd window, you need to change to that directory, for example, from the command line, type:
cd c:\pythonpractice # note that Windows is not case sensative but the *nix's areNow that you are in the correct folder, simply type "hello.py" (w/o quotes).
In short, do not use "py hello.py", just "hello.py"
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition