Re: SyntaxError: invalid syntax (windows)

2009-03-25 Thread Terry Reedy
MRAB wrote: Python Newsgroup wrote: Gotcha, I got started from the telnet example listed in the docs. The linux install was via yum and installed 2.x instead. That explains it. Althought print (tn.read_all () ) runs in 2.x on linux. I have another problem maybe you cna help me with. My telnet

Re: SyntaxError: invalid syntax (windows)

2009-03-25 Thread MRAB
Python Newsgroup wrote: Gotcha, I got started from the telnet example listed in the docs. The linux install was via yum and installed 2.x instead. That explains it. Althought print (tn.read_all () ) runs in 2.x on linux. I have another problem maybe you cna help me with. My telnet output jibb

Re: SyntaxError: invalid syntax (windows)

2009-03-25 Thread Python Newsgroup
Gotcha, I got started from the telnet example listed in the docs. The linux install was via yum and installed 2.x instead. That explains it. Althought print (tn.read_all () ) runs in 2.x on linux. I have another problem maybe you cna help me with. My telnet output jibberish in windows: I cna p

Re: SyntaxError: invalid syntax (windows)

2009-03-25 Thread Python Newsgroup
Thats newbe experience for ya ;-) thanks. Its seems to work and leads to another question. whether running the script or stepping thru the process at the command line I get what looks like hex C:\Python30>python \Python30\scripts\telnet-tftp1.py b'\x1b[24;1H\x1b[24;31H\x1b[24;1H\x1b[?25h\x1b[24

Re: SyntaxError: invalid syntax (windows)

2009-03-25 Thread MRAB
Python Newsgroup wrote: I'm a total newbe to scripting not to mention python. However I was able to successfully create a telnet script to initiate login, initiate tftp, exit, exit, confirm and close session. Frustrated, possibly causing my own misery. I replace the sript the script with the st

Re: SyntaxError: invalid syntax (windows)

2009-03-25 Thread Gary Herron
Python Newsgroup wrote: I'm a total newbe to scripting not to mention python. However I was able to successfully create a telnet script to initiate login, initiate tftp, exit, exit, confirm and close session. Frustrated, possibly causing my own misery. I replace the sript the script with the s

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread John Machin
ronrsr wrote: > the exact code that is triggering the error message is: > > zc = zsql.connect() Don't give us one line; give us the whole of the imported module plus the calling script (at least up to the place where it gets the error). That way we can see what is really going on, and someone wit

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread Steve Holden
ronrsr wrote: > the syntax error comes in the main program, in any line that follows > the import statement. > in which case, don't you think it might be the "import" statement that's causing the problem. What is stopping you from showing us the whole source? Or at least the import statement as

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread Fredrik Lundh
"ronrsr" <[EMAIL PROTECTED]> wrote: > the exact code that is triggering the error message is: > > zc = zsql.connect() individual statements don't "trigger" syntax errors; they're compiler errors, and only appear when do something that causes code to be compiled. > exact error message: SyntaxEr

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread ronrsr
the syntax error comes in the main program, in any line that follows the import statement. ronrsr wrote: > the exact code that is triggering the error message is: > > zc = zsql.connect() > > > exact error message: SyntaxError: Invalid Syntax > > > but any statement that follows the import state

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread ronrsr
the exact code that is triggering the error message is: zc = zsql.connect() exact error message: SyntaxError: Invalid Syntax but any statement that follows the import statement will trigger it. bests, r-sr- Roberto Bonvallet wrote: > ronrsr wrote: > > thanks for the speedy answer. wha

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread Roberto Bonvallet
ronrsr wrote: > thanks for the speedy answer. what i meant was: > > return MySQLdb.connect (host = "db91b.pair.com", > user = "homebase", >passwd = "Newspaper2", >db = "homebase_zingers" > );

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread ronrsr
thanks for the speedy answer. what i meant was: return MySQLdb.connect (host = "db91b.pair.com", user = "homebase", passwd = "Newspaper2", db = "homebase_zingers" ); but even when I have

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, ronrsr wrote: > def connect(): > > >return = MySQLdb.connect (host = "db91x..com", ^ You can't assign to a keyword. Just leave this ``=`` out. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread ronrsr
here's some of the surrounding code from the main program: querystring = querystring + " ORDER BY keywords "; #SQL import zsql zc = zsql.connect() print("return from open") zq = zc.query(querystring).dictresult() ronrsr wrote: > no matter where I place this imported file,the statement

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread Roberto Bonvallet
ronrsr wrote: > return = MySQLdb.connect (host = "db91x..com", > user = "", >passwd = "x", >db = "homebase_zingers" > ); return is a reserved keyword. You cannot have a variable

Re: SyntaxError: invalid syntax

2005-12-27 Thread Terry Hancock
On Tue, 27 Dec 2005 09:32:18 GMT "DIBS" <[EMAIL PROTECTED]> wrote: > >>> python sudoku.py > File "", 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

Re: SyntaxError: invalid syntax

2005-12-27 Thread Fredrik Lundh
"DIBS" <[EMAIL PROTECTED]> wrote: > >>> python sudoku.py > File "", 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- l

Re: SyntaxError: invalid syntax

2005-12-27 Thread DIBS
>>> python sudoku.py File "", line 1 python sudoku.py ^ >>>SyntaxError: invalid syntax Thanks for your help. The above is the extact message. DIBS "Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tue, 27 Dec 2005 07:40:12 +

Re: SyntaxError: invalid syntax

2005-12-27 Thread Fredrik Lundh
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 "", line 1 > x = x+*9 > ^ > SyntaxError: invalid syntax > > Just "SyntaxError" on its own is not enough to tell wha

Re: SyntaxError: invalid syntax

2005-12-27 Thread Steven D'Aprano
On Tue, 27 Dec 2005 07:40:12 +, 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