简体   繁体   中英

python command-line error ('python' is not defined)

I am very new to programming with python. (I am using Windows 10)

So I recently installed Python 3.5.2 and I am trying to write a simple command in the python command line (name of program: Python 3.5):

python -h

What I get:

Traceback (most recent call last):

File "$stdin$", line 1, in NameError: name 'python' is not defined

($ = <> by the way)

When I run it in CMD it works perfectly fine.

You can type in your program and then the command, for example $ ./example.py [-h] . You can also use -? or --help instead of -h

EDIT: In command line,

    $./programName.py [-h] -z

It should show you an error saying that -z is not recognized

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM