468,133 Members | 1,433 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,133 developers. It's quick & easy.

SyntaxError: invalid syntax

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.
Dec 27 '05 #1
5 19679
On Tue, 27 Dec 2005 07:40:12 +0000, DIBS wrote:
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:
x = x+*9

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.
--
Steven.

Dec 27 '05 #2
Steven D'Aprano wrote:
Please post the *full* traceback of the error, not just the last
description.

For example, something like this:
x = x+*9

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>

Dec 27 '05 #3
>>> python sudoku.py
File "<stdin>", line 1
python sudoku.py
^
SyntaxError: invalid syntax


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

DIBS


"Steven D'Aprano" <st***@REMOVETHIScyber.com.au> wrote in message
news:pa****************************@REMOVETHIScybe r.com.au...
On Tue, 27 Dec 2005 07:40:12 +0000, DIBS wrote:
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:
x = x+*9

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.
--
Steven.

Dec 27 '05 #4
"DIBS" <ma*@legs.com> wrote:
python sudoku.py File "<stdin>", line 1
python sudoku.py
^
SyntaxError: invalid syntax
Thanks for your help.
The above is the extact message.


that looks like the Python interpreter window, not the Windows command-
line window.

To run complete Python programs, type "python filename" in the Windows
command-line window (or double-click on filename from the explorer).

the FAQ has more information:

http://www.python.org/doc/faq/window...-under-windows

</F>

Dec 27 '05 #5
On Tue, 27 Dec 2005 09:32:18 GMT
"DIBS" <ma*@legs.com> wrote:
python sudoku.py File "<stdin>", line 1
python sudoku.py
^
SyntaxError: invalid syntax
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:
import sudoku


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

--
Terry Hancock (ha*****@AnansiSpaceworks.com)
Anansi Spaceworks http://www.AnansiSpaceworks.com

Dec 27 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Bradley Kite | last post: by
reply views Thread by Mark Phanides | last post: by
reply views Thread by cesare | last post: by
10 posts views Thread by ronrsr | last post: by
4 posts views Thread by Kai Kuehne | last post: by
7 posts views Thread by alf | last post: by
2 posts views Thread by quocduan | last post: by
27 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.