SyntaxError: invalid syntax

D

DIBS

I'm new to Python and I don't understand what I'm doing wrong.

I'm running windows xp.

In the command line window, I type:
Python Sudoku.py

and I get the response"

SyntaxError: invalid syntax

If anyone cane help me I'd be very grateful.
 
S

Steven D'Aprano

I'm new to Python and I don't understand what I'm doing wrong.

I'm running windows xp.

In the command line window, I type:
Python Sudoku.py

and I get the response"

SyntaxError: invalid syntax

If anyone cane help me I'd be very grateful.

Please post the *full* traceback of the error, not just the last
description.

For example, something like this:
File "<stdin>", line 1
x = x+*9
^
SyntaxError: invalid syntax


Just "SyntaxError" on its own is not enough to tell what is going on,
except to say that it sounds like a bug in the program you are trying to
run.
 
F

Fredrik Lundh

Steven said:
Please post the *full* traceback of the error, not just the last
description.

For example, something like this:

File "<stdin>", line 1
x = x+*9
^
SyntaxError: invalid syntax

Just "SyntaxError" on its own is not enough to tell what is going on,
except to say that it sounds like a bug in the program you are trying to
run.

or that he's using a program written for a newer version of Python than
the one he has on his machine...

</F>
 
D

DIBS

python sudoku.py
File "<stdin>", line 1
python sudoku.py
^




Thanks for your help.
The above is the extact message.

DIBS
 
F

Fredrik Lundh

T

Terry Hancock

File "<stdin>", line 1
python sudoku.py
^


Thanks for your help.
The above is the extact message.

Based on the ">>>" prompt, I'd say you tried to type this
into the python interactive interpreter. It's supposed to be
a shell command -- i.e. you *invoke* the python interpreter
to run the file from the command line.

If you are already running python, then you might get what
you want by importing the module:

but whether that's what you really want or not depends on
how the module is meant to be used (is it a "module" or a
"script"?).

Cheers,
Terry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top