Re: ElementTree handling nested tag

2010-10-03 Thread tekion
On Oct 2, 5:32 am, de...@web.de (Diez B. Roggisch) wrote: tekion tek...@gmail.com writes: All, I have the following xml tag: event resource_access       actionhttpRequest/action       httpurlHTTP://cmd.wma.ibm.com:80//httpurl       httpmethodGET/httpmethod       httpresponse200

Re: ElementTree handling nested tag

2010-10-03 Thread tekion
On Oct 3, 2:09 pm, de...@web.de (Diez B. Roggisch) wrote: tekion tek...@gmail.com writes: On Oct 2, 5:32 am, de...@web.de (Diez B. Roggisch) wrote: tekion tek...@gmail.com writes: All, I have the following xml tag: event resource_access       actionhttpRequest/action

ElementTree handling nested tag

2010-10-01 Thread tekion
All, I have the following xml tag: event resource_access actionhttpRequest/action httpurlHTTP://cmd.wma.ibm.com:80//httpurl httpmethodGET/httpmethod httpresponse200/httpresponse /resource_access /event I am interested in: actionhttpRequest/action

Having problem with subclass

2010-09-30 Thread tekion
All, I have file name A.py with a class name Aclass. I have a file name B.py with sub class of Aclass, like import A class Bclass(Aclass) ...rest of code When I test it, calling B.py, I am getting: class Bclas(Aclass): NameError: name 'Aclass' is not defined When I move Bclass to A.py, it

python ldap recursive

2010-07-13 Thread tekion
Hi, I know perl Net::LDAP could do a recursive search call to LDAP. What I am running into with Python LDAP on the search call is that I would l have to wait for the search to complete to get the result. Where as with Perl recursive search call, I would get the result (not the completed

Re: deriving MySQLdb class

2010-01-27 Thread tekion
On Jan 21, 11:48 pm, Sean DiZazzo half.ital...@gmail.com wrote: On Jan 21, 8:17 pm, tekion tek...@gmail.com wrote: Sean, I did a little investigation, there are other classes besides Connection. So, could I only set up a derived class from Connection and still be able to use

Re: easy_install error ...

2010-01-25 Thread tekion
FYI, I figured out what I was doing wrong. After reading the setuptools docs, I noticed took out the quotes around the package name and it works, see details below: python setup.py easy_install -m docutils==0.4 running easy_install Searching for docutils==0.4 Best match: docutils 0.4 Processing

easy_install error ...

2010-01-24 Thread tekion
All, I am running into issue with easy install error, see error below: python setup.py easy_install -m 'docutils==0.4' running easy_install error: Not a URL, existing file, or requirement spec: 'docutils==0.4' any idea as to why? thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: easy_install error ...

2010-01-24 Thread tekion
I am also having another issue with easy_install, python setup.py easy_install --find-links thirdparty 'docutils==0.4' running easy_install error: Not a URL, existing file, or requirement spec: 'docutils==0.4' I think both problem are related. I have setuptool version .6C11 install and I am

deriving MySQLdb class

2010-01-21 Thread tekion
All, I am trying to write a class which inherits from MySQLdb class. Below is code snippet: import MySQLdb import sys class msql_connect(MySQLdb): def __init__(self): self.host = hostname self.user = user self.password = passoword self.database =

Re: deriving MySQLdb class

2010-01-21 Thread tekion
Sean, I did a little investigation, there are other classes besides Connection. So, could I only set up a derived class from Connection and still be able to use the connection to query database and retrieve data? -- http://mail.python.org/mailman/listinfo/python-list

Re: python 2.x and running shell command

2009-12-24 Thread tekion
On Dec 23, 5:22 pm, Sean DiZazzo half.ital...@gmail.com wrote: On Dec 23, 1:57 pm, tekion tek...@gmail.com wrote: All, some of the servers I have run python 2.2, which is a drag because I can't use subprocess module.  My options that I know of is popen2 module.  However, it seems

python 2.x and running shell command

2009-12-23 Thread tekion
All, some of the servers I have run python 2.2, which is a drag because I can't use subprocess module. My options that I know of is popen2 module. However, it seems it does not have io blocking capabilities. So every time run a command I have open and close a file handle. I have command that

Re: converting string to a date format

2009-12-21 Thread tekion
Ben, I do not have python 2.6 install, my version of Python is 2.4. Because of my version of Python I believe I have to perform what you have suggested: This should, ideally, consist of two separate operations: * parse the string, using a specific format, to create a ‘datetime’ object *

Re: converting string to a date format

2009-12-21 Thread tekion
On Dec 21, 3:05 pm, MRAB pyt...@mrabarnett.plus.com wrote: tekionwrote: Ben, I do not have python 2.6 install, my version of Python is 2.4. Because of my version of Python I believe I have to perform what you have suggested: This should, ideally, consist of two separate operations:  

converting string to a date format

2009-12-20 Thread tekion
All, I know there is a datetime module for converting and manipulate date format. I have this string date format: 24/Nov/2009:10:39:03 -0500 and would like to convert it to a date format of 2009-11-24 10:39:03. At the moment I am reading datetime module trying to find out if I could do it with

tarfiles usage on python 2.4.4

2009-12-18 Thread tekion
All, I am using tarfile module and my python is version 2.4.4. When I call method extractall, I am getting error method does not exist. Could someone confirm if the method exist on python 2.4.4? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: figuring week of the day....

2009-01-17 Thread tekion
On Jan 9, 6:05 am, Tim Chase python.l...@tim.thechases.com wrote: Tim Chase wrote: tekion wrote: Is there a module where you could figure week of the day, like where it starts and end. I need to do this for a whole year. Thanks. the monthcalendar() call returns the whole month's calendar

figuring week of the day....

2009-01-08 Thread tekion
Is there a module where you could figure week of the day, like where it starts and end. I need to do this for a whole year. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

is there a way to determine a relative path to the script?

2009-01-02 Thread tekion
Hello, I have a script in /usr/local/app/mypython.py and a configuration file relative to /usr/local/app/conf. When I call the script with an absolute path of /usr/local/app/mypthon.py I recieved an error similar to the below error: Traceback (most recent call last): File

Re: Help with capturing error

2008-11-30 Thread tekion
Yes, you are absolutely right. I had open a file earlier and when it reach end of line with no new idea; it seems to have closed the file. I am not sure if this because I am using my own class to open and read a file or just a python behavior. I plan to test this out. On another note, is there a

trapping signal

2008-11-27 Thread tekion
I have a while iterates forever. I would like to trap a SIGTERM signal and execute some clean up code. How would I do this in python? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Help with capturing error

2008-11-27 Thread tekion
Hello, I am getting the following error and my script is bailing out because of it. I have tried capturing it but it does not seem to work. Below is the error: ValueError: I/O operation on closed file the above error is received when, the following code snippet is executed:

help with class

2008-11-26 Thread tekion
Hello, I am playing with class. Below is the code snippet: #!/usr/bin/python 2 3 class test_class: 4#import gzip 5def __init__(self,file): 6 self.file = file 7def open_file(self): 8 try: 9 print file: %s % self.file

Re: help with class

2008-11-26 Thread tekion
Hi, so I am assuming global name space refers to the location of where the module is imported, for example my previous example where I call the gzip module from test_class class, like so: class test_class: import gzip did not work because of scoping. So global name space in this case is

Re: help with comparison

2008-11-20 Thread tekion
On Nov 19, 11:36 pm, George Sakkis [EMAIL PROTECTED] wrote: On Nov 19, 10:21 pm,tekion[EMAIL PROTECTED] wrote: Hi, Could some one take a look at the below code snipet which keep failing: import optparse p = optparse.OptionParser(description=script to do stuff, prog=myscript.py

help with comparison

2008-11-19 Thread tekion
Hi, Could some one take a look at the below code snipet which keep failing: import optparse p = optparse.OptionParser(description=script to do stuff, prog=myscript.py, ) p.add_option(-c --compress, help=0 is noncompress) function1(options.compress) here's what the what function definition