cannot create python packages

2007-10-10 Thread Konstantinos Pachopoulos
Hi, i have the following files: current_dir/level1/Called.py current_dir/Caller.py Called.py: --- class Called: def exec1(self): print "Hello" Caller.py: -- from level1.Called import * c=Called() c.exec1() However it is impossible for Caller.py to find Called.py. I

find difference in days from YYYYMMDD to YYYYMMDD

2007-09-22 Thread Konstantinos Pachopoulos
Hi, does any body now any such algorith? to find difference in days from MMDD to MMDD? Or just an algorithm, that converts MMDD to seconds since the epoch? Thanks -- http://mail.python.org/mailman/listinfo/python-list

about __str__

2007-09-20 Thread Konstantinos Pachopoulos
Hi, i have the following class: === class CmterIDCmts: def __init__(self,commiterID,commits): self.commiterID_=long(commiterID) self.commits_=long(commits) def __str__(self): s="" s+="<"+str(self.commiterID_

cannot __getitem__ from DB reply list

2007-09-20 Thread Konstantinos Pachopoulos
Hi, i have the following function: def getGNUPlotInputFeaturesVersion(self): s="" bugCommits=0 trdocCommits=0 featCommits=0 ct=CommitType() for version in self.releaseVersionsList_: self.execQuery("SEL

raw string

2007-09-18 Thread Konstantinos Pachopoulos
Hi, i am trying to execute the following query on a DB: qe.execQuery(r"SELECT * FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM Commiter") However, whether i put the r in the front or not, i always get an error about the "\n". What's wrong? -- http://mail.pytho

find and remove "\" character from string

2007-09-15 Thread Konstantinos Pachopoulos
Hi, i have the following string s and the following code, which doesn't successfully remove the "\", but sucessfully removes the "\\". >>> s="Sad\\asd\asd" >>> newS="" >>> for i in s: ... if i!="\\": ... newS=newS+i ... >>> newS 'Sadasd\x07sd' I have also read the following,

trim start and trailing space chars from string

2007-09-15 Thread Konstantinos Pachopoulos
Hi, is there something corresponding to the java String.trim() method, ie trim start and trailing space/tab chars from string? say convert " asdf " to "asdf"? Thnx -- http://mail.python.org/mailman/listinfo/python-list

cannot declare global vars!

2007-09-13 Thread Konstantinos Pachopoulos
Hi, i had posted earlier for not being able to declare global vars. No i followed the suggestions and created a class, but still the vars do not seem to have a global scope. I have tried pretty much everything. Any advice appreciated... Here:

UnboundLocalError on global variable

2007-09-09 Thread Konstantinos Pachopoulos
Hi, i have a problem, the source of which is probably the fact, that i have not understood how to declare global variables - I use the Jython compiler, but i think this is a Python issue... First of all, i don not use any classes in this module. The problem is, that i declare and instantiate som