Python Forum

Full Version: Dazed and confused...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(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.
Pages: 1 2