Re: NameError: global name '' is not defined , but a bit differences

2013-09-05 Thread Mohsen Pahlevanzadeh
on is at : > > http://stackoverflow.com/questions/18627608/nameerror-global-name-is-not-defined-but-differences > > > > Before answering, Thank you for your attention...! > > > > > > Yours, > > Mohsen > > > > > > Please don't just po

Re: NameError: global name '' is not defined , but a bit differences

2013-09-05 Thread Terry Reedy
On 9/5/2013 1:38 AM, Benjamin Kaplan wrote: On Wed, Sep 4, 2013 at 9:17 PM, Mohsen Pahlevanzadeh wrote: i get the error : NameError: global name 'ui' is not defined Complete question is at : http://stackoverflow.com/questions/18627608/nameerror-global-name-is-not-defined-but-d

Re: NameError: global name '' is not defined , but a bit differences

2013-09-04 Thread Benjamin Kaplan
On Wed, Sep 4, 2013 at 9:17 PM, Mohsen Pahlevanzadeh wrote: > Dear all , > > i get the error : > > NameError: global name 'ui' is not defined > > Complete question is at : > http://stackoverflow.com/questions/18627608/nameerror-global-name-is-not-defined-bu

NameError: global name '' is not defined , but a bit differences

2013-09-04 Thread Mohsen Pahlevanzadeh
Dear all , i get the error : NameError: global name 'ui' is not defined Complete question is at : http://stackoverflow.com/questions/18627608/nameerror-global-name-is-not-defined-but-differences Before answering, Thank you for your attention...! Yours, Mohsen -- https://mail.

Re: Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread Chris Angelico
On Thu, Sep 6, 2012 at 10:07 PM, shaun wrote: > Hi Chris, > > I'm changing it into multiple classes because the script is going to get > much larger its more for maintainability reasons rather than functionality > reasons. Doesn't necessarily have to be multiple classes. Python gives you t

Re: Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread shaun
Hi Chris, I'm changing it into multiple classes because the script is going to get much larger its more for maintainability reasons rather than functionality reasons. Thanks so much man it was the "self" fix you stated above. I woe you a pint of Guinness :D Thanks again, Shaun -- http:/

Re: Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread MRAB
On 06/09/2012 12:37, shaun wrote: Sorry guys here is the full code for the class: #!/usr/bin/python # Echo client program import cx_Oracle import socket import pprint from struct import * import sys from binascii import * Don't use "from something import *". It'll import a whole load of names.

Re: Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread Chris Angelico
On Thu, Sep 6, 2012 at 9:37 PM, shaun wrote: > class StringCall: > results=[] > def databasebatchcall(self,termid, batchid): > con = > cx_Oracle.connect('user/[email protected]/ODB4TEST.COMPANY.IE') > cur = con.cursor() > c

Re: Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread shaun
This is the code in the script im calling: batchObject=StringCall() batchObject.databasebatchcall(termid, batchid) batchObject.fetchbatchdata() batchObject.createbatchstrings() BatchHeaderPacket =batchObject.returnbatchheader() ParameterPacket =batchObject.returnparameterpacket() TrailerPacket =

Re: Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread shaun
Sorry guys here is the full code for the class: #!/usr/bin/python # Echo client program import cx_Oracle import socket import pprint from struct import * import sys from binascii import * import time import datetime class StringCall: results=[] def databasebatchcall(self,termid,

Re: Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread Peter Otten
shaun wrote: > I have a class which I create an object from in a different script but when its run I get an error at the last part of this method: > def databasebatchcall(self,tid, bid): > con=cx_Oracle.connect( > 'user/[email protected]/ODB4TEST.COMPANY.COM') > c

Re: Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread Dave Angel
On 09/06/2012 06:45 AM, shaun wrote: > Hi all, > > I have a class which I create an object from in a different script but when > its run I get an error at the last part of this method: > > CODE/// > > def databasebatchcall(self,tid, bid): > > con=cx_Oracle

Re: Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread Chris Angelico
On Thu, Sep 6, 2012 at 8:45 PM, shaun wrote: > CODE/// > > def databasebatchcall(self,tid, bid): > > con=cx_Oracle.connect('user/[email protected]/ODB4TEST.COMPANY.COM') > cur = con.cursor() > cur.execute("SELECT * FROM name) >

Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread shaun
Hi all, I have a class which I create an object from in a different script but when its run I get an error at the last part of this method: CODE/// def databasebatchcall(self,tid, bid): con=cx_Oracle.connect('user/[email protected]/ODB4TEST.COMPA

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: [email protected] > Subject: global name is not def

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

global name is not defined

2007-11-06 Thread barronmo
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 I need to pass from one module to another and is called 'EMR_globals'. Several othe

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

2007-09-21 Thread Mridula Ramesh
thanks! that fixed it :) -- http://mail.python.org/mailman/listinfo/python-list

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

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

2007-09-20 Thread Mridula Ramesh
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 widgets rt = Tk() showbuttons() #call the scrolle

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

global name is not defined - error - but for array

2006-06-27 Thread a
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 thanks -a -- http://mail.python.org/mailman/listinfo/pyt

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.

global name is not defined - error

2006-06-27 Thread a
What I want --- I want to create a list of items from a function operating on an array of strings What I did - list=["s0","s1","s2"] l=len(list) for i in range(l): d_list[i]=f.do(list[i]) print d_l