Python Forum
[Error 2] running from cmd win 10 fresh install
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Error 2] running from cmd win 10 fresh install
#2
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:
cd c:\pythonpractice    # note that Windows is not case sensative but the *nix's are
Now 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
Reply


Messages In This Thread
RE: [Error 2] running from cmd win 10 fresh install - by sparkz_alot - Mar-02-2017, 02:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  error "cannot identify image file" part way through running hatflyer 0 802 Nov-02-2023, 11:45 PM
Last Post: hatflyer
  Install error middlestudent 1 857 Sep-23-2023, 08:26 AM
Last Post: middlestudent
  Error when running kivy on python janeik 8 2,284 Jun-16-2023, 10:58 PM
Last Post: janeik
  wxPython install error carlomscalisi 3 3,798 Jan-17-2023, 11:04 AM
Last Post: snippsat
  Getting error when running "MINUS" between 2 databases marlonbown 4 1,399 Nov-10-2022, 05:49 AM
Last Post: deanhystad
  Error with pip install coffeeguy 1 2,487 Sep-08-2022, 01:27 AM
Last Post: snippsat
  Error while running code on VSC maiya 4 3,998 Jul-01-2022, 02:51 PM
Last Post: maiya
  Pandas - error when running Pycharm, but works on cmd line zxcv101 1 1,425 Jun-18-2022, 01:09 PM
Last Post: snippsat
  kmeans install error (please help me) muratuzun 3 5,933 May-06-2022, 02:14 PM
Last Post: snippsat
  Error when running a matplot lib example aurelius_nero 3 7,235 Apr-24-2022, 01:24 PM
Last Post: Axel_Erfurt

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020