Re: global name is not defined

2007-11-07 Thread barronmo
Thanks, seems to be fixed with importing MySQLdb, menus, EMR_main, etc in the Name_find module. Is there a better way to do things? I thought I was avoiding using global variables by putting the shared ones in their own module. Thanks for the help. Mike -- http://mail.python.org/mailman/listi

RE: global name is not defined

2007-11-06 Thread Looney, James B
Looks like you forgot to import EMR_globals, EMR_main, etc. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > ] On Behalf Of barronmo > Sent: Tuesday, November 06, 2007 2:57 PM > To: python-list@python.org > Subject: global name is not defined > > I'm getting

Re: global name is not defined

2007-11-06 Thread Gabriel Genellina
En Tue, 06 Nov 2007 18:57:12 -0300, barronmo <[EMAIL PROTECTED]> escribió: > I'm getting an error msg I don't understand, "global name EMR_globals > is not defined", and could use some help. > > I've separated the application I'm building into several modules. One > of the modules holds variables

Re: global name is not defined - but this is actually a function's name

2007-09-20 Thread Amit Khemka
On 9/21/07, Mridula Ramesh <[EMAIL PROTECTED]> wrote: > hi. > > i'm a beginner and i'm trying to get the hang of classes and functions. my > code looks like this: > > > > class showRecord(main): > def __init__(self): > global gmax > #now to create the screen by placing all the

Re: global name is not defined - error

2006-06-28 Thread a
i changed it to append and it started working but once in a while i m getting l_code.append( len(d_list_code[i]['entries']) ) IndexError: list index out of range but it is not permanent if i refresh, it goes away! Marco Wahl wrote: > "a" <[EMAIL PROTECTED]> writes: > > > What I want > > --

Re: global name is not defined - error

2006-06-28 Thread Bruno Desthuilliers
a wrote: > What I want > --- > I want to create a list of items from a function operating on an array > of strings def func(s): return s.upper() arrayOfStrings = ['bicycle', 'repair', 'man'] print "solution 1: with map()" print map(func, arrayOfStrings) print "solution 2: with list

Re: global name is not defined - error - but for array

2006-06-28 Thread Steve Holden
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 > > subsequently i should access or define count as an array > > error: > global name 'count' is not defined > The questions you are aski

Re: global name is not defined - error - but for array

2006-06-28 Thread Fredrik Lundh
"a" <[EMAIL PROTECTED]> 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 a couple of notes: 1) global statements should be placed at the top of the function 2) objects don't appear out of now

Re: global name is not defined - error

2006-06-27 Thread Marco Wahl
"a" <[EMAIL PROTECTED]> writes: > What I want > --- > I want to create a list of items from a function operating on an array > of strings Ok. > What I did > - > list=["s0","s1","s2"] > l=len(list) > for i in range(l): > d_list[i]=f.