Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dazed and confused...
#11
(May-28-2017, 03:41 AM)RodNintendeaux Wrote: Note: "C:\Windows\System32>cd\" outputs "

Not sure if this is exactly as you typed it in, if it is, it is wrong :-). "cd" is "change directory" in Windows speak, so it expects the path to the new directory, if "outputs" is the directory, the command would be cd C:\outputs or cd \outputs should also work.

The "pip" and "python" commands are a part of Python and if your environmental variables are correct, then no, you do not need to "cd" anywhere to use them. Your personal directory (where you keep your scripts) is not in the environmental variables, so you have to tell Python where your script is. Two ways to do that are to navigate to your directory (using the command terminal or cmdr or whatever) then type in your script name filename.py
Note: the ".py" extension is required). The second way is to open the "File Explorer", open the directory of your script and double click it.  The drawback to this method is that, if there nothing to stop it, Python will open a terminal window, run the script, exit and close the window. If you script for example has the single line:

print("Hello World")
this process will happen so quickly, you most likely won't even see it happen, leading you to believe your script never ran and therefore must be broken.
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


Possibly Related Threads…
Thread Author Replies Views Last Post
  String int confused janeik 7 1,017 Aug-02-2023, 01:26 AM
Last Post: deanhystad
  I am confused with the key and value thing james1019 3 912 Feb-22-2023, 10:43 PM
Last Post: deanhystad
  Pandas confused DPaul 6 2,469 Sep-19-2021, 06:45 AM
Last Post: DPaul
  is and '==' i'm confused hshivaraj 6 2,626 Sep-15-2021, 09:45 AM
Last Post: snippsat
  Confused with 'flags' tester_V 10 4,788 Apr-12-2021, 03:03 AM
Last Post: tester_V
  Simple Tic Tac Toe but I'm confused Izith 1 2,157 Sep-26-2020, 04:42 PM
Last Post: Larz60+
  I am really confused with this error. Runar 3 2,927 Sep-14-2020, 09:27 AM
Last Post: buran
  Confused on how to go about writing this or doing this... pythonforumuser 3 2,422 Feb-10-2020, 09:15 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

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