Verifying I installed Python correctly

Dennis Lee Bieber wlfraed at ix.netcom.com
Mon Apr 25 15:42:26 EDT 2022


tOn Sun, 24 Apr 2022 13:59:53 -0400, Greg <gd75291 at gmail.com> declaimed the
following:

>I am trying to get Hello World to appear under my directory. The files of
>
>*C:\Users\gd752>cd C:\google-python-exercises> python hello.py*
>*The system cannot find the path specified.*
>
>*C:\Users\gd752>cd C:\google-python-exercises>*
>*The syntax of the command is incorrect.*
>
>I installed version 3.10. I am stuck and could use some help.
>Thx,
>
>
>[image: directory pic.png]

	Text only, no images on this forum.

	Cut&Paste the TEXT from your console window, not a screen grab.

	And... with that... show us the exact text. The text you show above IS
invalid -- paths do not end with > character (that, when shown at the start
of a command, is the prompt delimiter) and (normally space separated) is
the output redirection operator when it follows a command.

Your SECOND line, assuming the prompt string is just "C:\Users\gd752>"  is
trying to change directory to a path of "C:\google-python-exercises>" which
is not valid. Take off the trailing >

05/29/2018  09:58 AM    <DIR>          wekafiles
06/18/2020  09:43 PM    <DIR>          workspace_v10
08/23/2018  11:25 AM    <DIR>          workspace_v6_0
01/08/2018  01:45 PM    <DIR>          workspace_v7
07/08/2019  12:10 PM    <DIR>          workspace_v9
              67 File(s)    355,065,731 bytes
              44 Dir(s)  650,737,876,992 bytes free

C:\Users\Wulfraed>cd wekafiles>
The syntax of the command is incorrect.

C:\Users\Wulfraed>cd wekafiles

C:\Users\Wulfraed\wekafiles>

	Actually, based upon

C:\Users\Wulfraed\wekafiles>cd ..

C:\Users\Wulfraed>cd wekafiles> test.dat

C:\Users\Wulfraed\wekafiles>

the > is acceptable -- AS OUTPUT REDIRECTION, but the your second line does
not specify the target for said redirection (not that CD has much in the
way of output).

	This means your first line is attempting to do a CD with output
redirection to a file with a questionable name

C:\Users\Wulfraed>cd wekafiles> python anything.dat
The system cannot find the path specified.


C:\Users\Wulfraed>dir python
 Volume in drive C is OS
 Volume Serial Number is 4ACC-3CB4

 Directory of C:\Users\Wulfraed

04/25/2022  03:29 PM                 0 python
               1 File(s)              0 bytes
               0 Dir(s)  650,748,653,568 bytes free

C:\Users\Wulfraed>

	It appears to have created a file with the name python, and then failed
attempting to parse the anything.dat


	So... To run your script you have two choices...

DIRECT invocation (from anywhere -- hence "prompt" could show anything)
prompt> python C:\google-python-exercises\hello.py

INDIRECT
prompt> cd C:\google-python-exercises
C:\google-python-exercises> python hello.py

(note that the prompt has changed to reflect the CD of the first line)

	In neither of those do you ever type a > character.


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	wlfraed at ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/


More information about the Python-list mailing list