Re: how do i make an array global

2006-06-29 Thread Fredrik Lundh
a wrote: > i understand index error > but there is no index error in my code that is the problem! so who wrote the "c:\mark\web1\code.py" file ? > > File "c:\mark\web1\code.py", line 64, in GET > > l_code.append( len(d_list_code[i]['entries']) ) > > IndexError: list index out of range m

Re: how do i make an array global

2006-06-29 Thread a
i understand index error but there is no index error in my code that is the problem! Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, a wrote: > > > Traceback (most recent call last): > > File "C:\Python24\lib\site-packages\web.py", line 2054, in > > run_wsgi_app > > result = self.se

Re: how do i make an array global

2006-06-29 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, a wrote: > Traceback (most recent call last): > File "C:\Python24\lib\site-packages\web.py", line 2054, in > run_wsgi_app > result = self.server.app(env, self.wsgi_start_response) > File "C:\Python24\lib\site-packages\web.py", line 1894, in wsgifunc > result = f

Re: how do i make an array global

2006-06-28 Thread a
please tell me how to do it if i should not make it global like you guys worry i m not comfortable making it global and mutating it in every subblock thanks for reading and helping out -- http://mail.python.org/mailman/listinfo/python-list

Re: how do i make an array global

2006-06-28 Thread a
hi bruno georg and erik you are right i m a newbie, i just want to do some stuff read out some stuff from a feed and display it in a page, so my py code, builds this list and when it goes to cheetah it gives me an error and hence i posted global has fixed the error but i keep getting this again and

Re: how do i make an array global

2006-06-28 Thread Erik Max Francis
Georg Brandl wrote: > No need for "global" here. Yes, that's true. I was just following the original poster's lead, but I tend to use a `global` statement whenever I'm mutating a global in a local block. That works as self-documentation and means you don't have to be concerned about the prec

Re: how do i make an array global

2006-06-28 Thread Georg Brandl
Bruno Desthuilliers wrote: > Georg Brandl wrote: >> Bruno Desthuilliers wrote: >> >>>a wrote: >>> def fn(): for i in range(l) >>> >>>l is not defined - you should have an error here. >>> >>> global count count[i]= how do i declare count to b

Re: how do i make an array global

2006-06-28 Thread Bruno Desthuilliers
Georg Brandl wrote: > Bruno Desthuilliers wrote: > >>a wrote: >> >>>def fn(): >>> for i in range(l) >> >>l is not defined - you should have an error here. >> >> >>> global count >>> count[i]= >>> >>>how do i declare count to be global if it is an array >> >>Just like i

Re: how do i make an array global

2006-06-28 Thread Georg Brandl
Bruno Desthuilliers wrote: > a wrote: >> def fn(): >> for i in range(l) > > l is not defined - you should have an error here. > >>global count >>count[i]= >> >> how do i declare count to be global if it is an array > > Just like it was an integer No. If he's on

Re: how do i make an array global

2006-06-28 Thread Georg Brandl
Erik Max Francis wrote: > a wrote: > >> def fn(): >> for i in range(l) >>global count >>count[i]= >> >> how do i declare count to be global if it is an array > > count = [...] > > def fn(): > global count > for i in range(l): >

Re: how do i make an array global

2006-06-28 Thread Bruno Desthuilliers
a wrote: > def fn(): > for i in range(l) l is not defined - you should have an error here. >global count >count[i]= > > how do i declare count to be global if it is an array Just like it was an integer > subsequently i should access or define count as an array

Re: how do i make an array global

2006-06-27 Thread Erik Max Francis
a wrote: > def fn(): > for i in range(l) >global count >count[i]= > > how do i declare count to be global if it is an array count = [...] def fn(): global count for i in range(l): count[i] = ... -- Erik