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/user...@odb4.dcc.company.ie/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/user...@odb4.dcc.company/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/user...@odb4.dcc.company/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/user...@odb4.dcc.company/ODB4TEST.COMPA