Hello,
Can any one help for error in following code.
actually i want to map parent element with child element, but i am unable to
do so.
here is the code which i am trying for please do reply if iam not on right
track.
import xml.sax.handler
class BookHandler(xml.sax.handler.ContentHandler):
On Mar 19, 8:11 am, Bruno Desthuilliers wrote:
> Hitesh a écrit :
>
> > On Mar 18, 12:28 am, "Hitesh" <[EMAIL PROTECTED]> wrote:
> >> Hi,
>
> >> I've a list like this..
> >> str1 = ['this is a test string inside list']
On Mar 18, 12:28 am, "Hitesh" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've a list like this..
> str1 = ['this is a test string inside list']
>
> I am doing it this way.
>
> for s in str1:
> temp_s = s
> print temp_s
>
> Any
Hi,
I've a list like this..
str1 = ['this is a test string inside list']
I am doing it this way.
for s in str1:
temp_s = s
print temp_s
Any better suggestions?
Thank you,
hj
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 13, 11:00 am, Bruno Desthuilliers wrote:
> Hitesh a écrit :
>
> > On Mar 12, 4:33 pm, Bruno Desthuilliers
> > <[EMAIL PROTECTED]> wrote:
> >> Hitesh a écrit :
>
> (snip)
> > Thank you for your reply.
> > From the return value I am trying
On Mar 12, 4:33 pm, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> Hitesh a écrit :
>
> > import string
> > import os
>
> > f = open ("c:\\servername.txt", 'r')
> > linelist = f.read()
>
> > lineLog = string.split(linelis
On Mar 12, 2:12 pm, "Hitesh" <[EMAIL PROTECTED]> wrote:
> On Mar 12, 1:58 pm, "Hitesh" <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > import string
> > import os
>
> > f = open ("c:\\servername.txt", 'r')
>
On Mar 12, 1:58 pm, "Hitesh" <[EMAIL PROTECTED]> wrote:
> import string
> import os
>
> f = open ("c:\\servername.txt", 'r')
> linelist = f.read()
>
> lineLog = string.split(linelist, '\n')
> lineLog = lineLog [:-1]
>
import string
import os
f = open ("c:\\servername.txt", 'r')
linelist = f.read()
lineLog = string.split(linelist, '\n')
lineLog = lineLog [:-1]
#print lineLog
for l in lineLog:
path1 = "" + l + "\\server*\\*\\xtRec*"
glob.glob(path1)
When I run above from command line python, It prin
On Mar 5, 4:44 am, Tim Golden <[EMAIL PROTECTED]> wrote:
> Hitesh wrote:
> > Hi currently I am using DNS and ODBC to connect to MS SQL database.
> > Is there any other non-dns way to connect? If I want to run my script
> > from different server I first have to create
Hi currently I am using DNS and ODBC to connect to MS SQL database.
Is there any other non-dns way to connect? If I want to run my script
from different server I first have to create the DNS in win2k3.
Thank you,
hj
--
http://mail.python.org/mailman/listinfo/python-list
There was a typo. I corrected it.
Hitesh wrote:
> How about this:
>
> def TruncateString(s, Tindex):
> return string.ljust(s,Tindex){:Tindex]
>
>
> s = '\\serverName\\C:\\Folder Name1\\FolderName2\\example.exe -u ABC -g
>
> XYZ'
> try:
>
tring(s, Sindex)
except:
pass
hj
Hitesh wrote:
> I post a crappy solution but I can add few more stuff to make it fail
> proof.
> i.e. I can search for ".exe -u"
> But if someone names folder like "folder.exe u". This script could
> fail.
> Or if in p
Thanks everyone for your help.
Grant Edwards wrote:
> On 2006-08-16, Hitesh <[EMAIL PROTECTED]> wrote:
>
> > anything after .exe should be truncated (or deleted).
>
> That will fail if any directory names contain the string
> ".exe", but if that
Here is a mediocare solution.
def TruncateString(s, Tindex):
return string.ljust(s,Tindex){:Tindex]
s = '\\serverName\\C:\\Folder Name1\\FolderName2\\example.exe -u ABC -g
XYZ'
Sindex = s.find(".exe")
Sindex = Tindex +4
s1 = TruncateString(s, Sindex)
Hitesh wrote:
&
anything after .exe should be truncated (or deleted).
Grant Edwards wrote:
> On 2006-08-16, Hitesh <[EMAIL PROTECTED]> wrote:
>
> > That might work but what if I get (in future) a path name where
> > foldername (and in windows it is very common, someone might name a
&
the right side:
>
> s='\\serverName\C:\FolderName1\FolderName2\example.exe' -u ABC -g XYZ
> p=s.split(" ", 1)[0]
> print p
>
> '\\serverName\C:\FolderName1\FolderName2\example.exe'
>
> Larry Bates
>
> Hitesh wrote:
> >
> >
> &g
ight side:
>
> s='\\serverName\C:\FolderName1\FolderName2\example.exe' -u ABC -g XYZ
> p=s.split(" ", 1)[0]
> print p
>
> '\\serverName\C:\FolderName1\FolderName2\example.exe'
>
> Larry Bates
>
> Hitesh wrote:
> >
> >
> > Hi,
>
the index but
don't know how to get rid any garbase after index + 4
hj
Dennis Lee Bieber wrote:
> On 16 Aug 2006 09:00:57 -0700, "Hitesh" <[EMAIL PROTECTED]> declaimed
> the following in comp.lang.python:
>
> >
> > Thank you Fredrik. That works for a str
Thank you guys.
hj
Duncan Booth wrote:
> Hitesh wrote:
>
> > In python doc -- 4.1.4 Deprecated string functions -- I read that "The
> > following list of functions are also defined as methods of string and
> > Unicode objects; see ``String Methods'' (sec
Hi,
In python doc -- 4.1.4 Deprecated string functions -- I read that "The
following list of functions are also defined as methods of string and
Unicode objects; see ``String Methods'' (section 2.3.6) for more
information on those. You should consider these functions as
deprecated, although they
nks,
hj
Tim Williams wrote:
> On 16/08/06, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> > On 16 Aug 2006 09:00:57 -0700, "Hitesh" <[EMAIL PROTECTED]> declaimed
> > the following in comp.lang.python:
> >
> > >
> > > Thank you Fredrik. Th
the earth I can remove those paranthesis?
ty
hj
Fredrik Lundh wrote:
> "Hitesh" wrote:
>
> > I get path strings from a DB like:
> >
> > \\serverName\C:\FolderName1\FolderName2\example.exe
> >
> > I am writing a script that can give me access to that
Hi,
I get path strings from a DB like:
\\serverName\C:\FolderName1\FolderName2\example.exe
I am writing a script that can give me access to that exe file.
But problem is that string is not universal path, I need to add C$.
Any idea how I can add $ char in that string.
ServerName is not fixed len
print file_list[-2]
return file_list[-2]
if __name__ == '__main__':
path = r'srv12\\c$\\backup\\my_folder'
create_date, prev_file = findfile(path)
Thank you
hj
Hitesh wrote:
> Hi,
>
> I have a small script here that goes to inside dir and sorts th
John Machin wrote:
> Hitesh wrote:
> > Hi,
> >
> > I have a small script here that goes to inside dir and sorts the file
> > by create date. I can return the create date but I don't know how to
> > find the name of that file...
> > I need file that i
stuff with DB so I am
going to work on ODBC connection using python.. interesting stuff.
Thank you all,
hj
Hitesh wrote:
> Hi,
>
> I have a small script here that goes to inside dir and sorts the file
> by create date. I can return the create date but I don't know how to
> find the
Hi,
I have a small script here that goes to inside dir and sorts the file
by create date. I can return the create date but I don't know how to
find the name of that file...
I need file that is not latest but was created before the last file.
Any hints... I am newbiw python dude and still trying t
All right I got it. Thank you anyway...
create_date = os.stat(pathname)[ST_CTIME]
print time.strftime("%Y%m%d", time.gmtime(create_date))
Hitesh wrote:
> Hi,
>
> Any hint on converting time from ST_CTIME secs into mmdd format?
> sorry for one-liner stupid question
Hi,
Any hint on converting time from ST_CTIME secs into mmdd format?
sorry for one-liner stupid question.. I couldn;t find (or rather figure
out) in docs.
Thank you,
hj
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I am newbie python dude. I need few hints.
I created a DB table with following fields
UserID(PK), TimeStamp, Version, IP, Port
I need to insert these info from this .log file and the log file has
lines like following with some junk garbase like "attempt using client
software " I need to get
Thank you all for the quick replies. It worked! Truely appriciated. I
am python novice and still learning I hope to contribute to this
group someday :)
Hitesh
--
http://mail.python.org/mailman/listinfo/python-list
Thank you Robert, It worked!!!
Thank you so much
--
http://mail.python.org/mailman/listinfo/python-list
ok here is the deal... I figured out how to pass the variable but now
messages are not popping up on the windows screen if I use this method:
import os
Computerlist = ['PC1', 'PC2', 'PC3', 'PC4', 'PC5']
for ComputerName in Computerlist:
print ComputerName
s = "net send %s" % ComputerName
Hi,
I wanted to pass a popup mesage using windows messagin service to five
PCs.
If I just use following then PC1 gets the popup service message:
import os
os.system('net send PC1 "Message"')
But if I try to create a for loop like this it doesn't work how can
I pass computerName var as an a
35 matches
Mail list logo