Re: a strange SyntaxError

2007-12-10 Thread Peter Otten
John Machin wrote: > As viewed with Google Groups, lines 40/41, 63/69, and 89 are indented 8 > spaces more than they should be. > > When I save your file and try to run it, I get this: C:\junk>coolgenie.py > File "C:\junk\coolgenie.py", line 40 > self.w = 520 > ^ > IndentationError: une

Re: a strange SyntaxError

2007-12-10 Thread Vladimir Rusinov
> self.numlines = self.config['numlines'] > > self.w = 520 > self.h = 12*self.numfeeds*(self.numlines+1) why extra ident here? -- Vladimir Rusinov GreenMice Solutions: IT-решения на базе Linux http://greenmice.info/ -- http://mail.python.org/mailman/listinfo/py

Re: a strange SyntaxError

2007-12-09 Thread Steve Howell
--- CoolGenie <[EMAIL PROTECTED]> wrote: > OK, sorry, this was about indents. Stupid VIM! One more piece of VIM advice. You can use "set list" to show where tabs are. I prefer to convert my own tabs to spaces automatically, but you inevitably come across code that you don't own where it's nice

Re: a strange SyntaxError

2007-12-09 Thread Steve Howell
--- CoolGenie <[EMAIL PROTECTED]> wrote: > OK, sorry, this was about indents. Stupid VIM! No prob. Add something like this (untested) to your ~/.vimrc: set expandtab set sw=4 set ts=4 Looking for

Re: a strange SyntaxError

2007-12-09 Thread Samuel
On Sun, 09 Dec 2007 12:35:46 -0800, CoolGenie wrote: > OK, sorry, this was about indents. Stupid VIM! $ mkdir -p $HOME/.vim/ftplugin/ $ echo "setlocal sw=4 setlocal ts=4 noremap py o/**/ " >> ~/.vim/ftplugin/python.vim $ echo "syntax on set sw=2 set ts=2 set nu set nuw=3 set autoin

Re: a strange SyntaxError

2007-12-09 Thread Steve Howell
--- CoolGenie <[EMAIL PROTECTED]> wrote: > self.feed = self.config['feedsrc'] > self.numfeeds = self.config['numfeeds'] > self.numlines = self.config['numlines'] > > self.w = 520 > self.h = 12*self.numfeeds*(self.numlines+1) > adesklets.

Re: a strange SyntaxError

2007-12-09 Thread John Machin
On Dec 10, 7:15 am, CoolGenie <[EMAIL PROTECTED]> wrote: > Hi! > I'm trying to write a small adesklet that will read newsfeeds. Here's > the code: > > # > # > # fparser.py > # > # P. Kaminski <[EMAIL PROTECTED]> > # Time-stamp: <>

Re: a strange SyntaxError

2007-12-09 Thread CoolGenie
OK, sorry, this was about indents. Stupid VIM! -- http://mail.python.org/mailman/listinfo/python-list

a strange SyntaxError

2007-12-09 Thread CoolGenie
Hi! I'm trying to write a small adesklet that will read newsfeeds. Here's the code: # # # fparser.py # # P. Kaminski <[EMAIL PROTECTED]> # Time-stamp: <> ## impor

Re: strange SyntaxError

2005-02-26 Thread Scott David Daniels
Attila Szabo wrote: 2005, Feb 25 -> Scott David Daniels wrote : Attila Szabo wrote: >>...lambda x: 'ABC%s' % str(x) ... OK, to no real effect, in main you define an unnamed function that you can never reference. Pretty silly, but I'll bite. This code was simplified, the lambda was part of a m

Re: strange SyntaxError

2005-02-25 Thread Attila Szabo
2005, Feb 25 -> Scott David Daniels wrote : > Attila Szabo wrote: > >Hi, > >def main(): > >lambda x: 'ABC%s' % str(x) > >for k in range(2): exec('print %s' % k) > OK, to no real effect, in main you define an unnamed function that > you can never reference. Pretty silly, but I'll bi

Re: strange SyntaxError

2005-02-25 Thread Terry Reedy
"Attila Szabo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I wrote this sample piece of code: > > def main(): >lambda x: 'ABC%s' % str(x) >for k in range(2): exec('print %s' % k) > > main() > > With the lambda line, I get this: > SyntaxError: unqualified

Re: strange SyntaxError

2005-02-25 Thread Scott David Daniels
Attila Szabo wrote: Hi, def main(): lambda x: 'ABC%s' % str(x) for k in range(2): exec('print %s' % k) OK, to no real effect, in main you define an unnamed function that you can never reference. Pretty silly, but I'll bite. Next you run run a loop with exec looking like you think i

strange SyntaxError

2005-02-25 Thread Attila Szabo
Hi, I wrote this sample piece of code: def main(): lambda x: 'ABC%s' % str(x) for k in range(2): exec('print %s' % k) main() With the lambda line, I get this: SyntaxError: unqualified exec is not allowed in function 'main' it con