473,395 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 20320
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bradley Kite | last post by:
Hi all. I'm trying to diagnose/solve a problem with internet explorer, whereby sometimes the form submits, and other times IE produces an 'invalid syntax' error. First, I have a form, and...
0
by: Mark Phanides | last post by:
My ASP.NET application intermittantly (but always at same point) redirects to the 'Invalid Syntax Error' web page for some unknown reason. I've created a ASP.NET application written in VB.NET with...
0
by: cesare | last post by:
hi, i'm very new to python and am experiencing the following problem: an identical program that runs on certain computers crashes on other machines due to Carriage Returns (CR; 0x0a) that now...
10
by: ronrsr | last post by:
no matter where I place this imported file,the statement after it in the main program gets a syntax error, regardless of the syntax. I think I may have changed something in this file, but I'm...
4
by: Kai Kuehne | last post by:
Hi list! I'm using pygmalion (magnolia api access lib) and want to use the following method that it is offering: magnolia.bookmarks_find(person='user', from=some_datetime) As you may noticed,...
7
by: alf | last post by:
Hi, I wonder why it is an invalid syntax: File "<stdin>", line 1 if 1: if 1: if 1: print 1 or
6
by: Nathan Pinno | last post by:
Why does my compiler say invalid syntax and then highlight the quotation marks in the following code: # This program is to find primes. primes = import math import gmpy while 1: run =...
2
by: quocduan | last post by:
I am learning Python, and i get an error in following: i already create a module hello.py in following: def print_func(par): print par return then, i open new window of Python, and type...
1
by: Jake Colborn | last post by:
Hey, I just picked up python again after not coding with it for many years. But I wanted to throw some simple scripts together to see if I remember all the functionality so far. Now I've got this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.