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 bruno.
[EMAIL PROTECTED] 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']
I am doing it this way.
for s in str1:
temp_s = s
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 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 better suggestions?
Thank you,
hj
I want to cast value of a list into string
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(linelist, '\n')
lineLog = lineLog [:-1]
#print lineLog
for l in lineLog:
path1
On Mar 13, 11:00 am, Bruno Desthuilliers bruno.
[EMAIL PROTECTED] 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 to figure out whether the file
xtRec* exist
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 prints
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]
#print lineLog
for l in lineLog:
path1 = + l + \\server*\\*\\xtRec*
glob.glob
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')
linelist = f.read()
lineLog = string.split(linelist, '\n')
lineLog = lineLog [:-1]
#print lineLog
for l
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 the DNS in win2k3.
Here are several
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
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
:
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 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
, 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. That works for a string.
But I am getting list of tuples from DB.
rows = [('\\serverName\C:\FolderName1\FolderName2
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
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'' (section 2.3.6) for more
information on those. You
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 string.
But I am getting list of tuples from DB.
rows = [('\\serverName\C
\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,
Everything is working fine and dandy but I ran across another issue
here.
Some of the path comes with some extra
-g XYZ
p=s.split( , 1)[0]
print p
'\\serverName\C:\FolderName1\FolderName2\example.exe'
Larry Bates
Hitesh wrote:
Hi,
Everything is working fine and dandy but I ran across another issue
here.
Some of the path comes with some extra chars padded at the end.
i.e
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
folder something like Screw You
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
.
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's what you want, it's trivial enough:
for s in [asdfasdf.exe -u, soemthing/else,
asdf.exe
:
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 padded garbase I get .exe u
These are two known issues I have to takcle
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:
Sindex = s.find(.exe)
if Sindex 0:
Sindex
.. 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 name of that file...
I need file that is not latest but was created before the last file
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 is not latest but was created before the last file.
Any
]
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 the file
by create date. I can return the create date but I don't know how
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
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.. I couldn;t find (or rather
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
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
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
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
Thank you Robert, It worked!!!
Thank you so much
--
http://mail.python.org/mailman/listinfo/python-list
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
35 matches
Mail list logo