replacing string in xml file

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu May 10 01:45:53 EDT 2007


En Thu, 10 May 2007 01:55:25 -0300, <saif.shakeel at gmail.com> escribió:

>>                     I am opening 2 more files in addition to the file
>> where the new xml goes.One file is written using the sys.stdout
>> command as most of the output has to go there printing takes place in
>> many places (so cant use f_open.write) each time.
>>                     When i attach the part of replacing the string
>> 'localid' in xml file with something else as given above with
>> xmlcont=xmlcont.replace('localId','dataPackageId')
>> the code does not run and hangs.

What do you mean by "hangs"?
You have replaced stdout - what if the program is prompting the user for  
something, and you can't see it? Can you type some text and continue?

>> Can more than 3 files be opened at a
>> time

Sure. The limit actually depends on the OS, but on "normal" circumstances  
it's far above 3 files.

-- 
Gabriel Genellina




More information about the Python-list mailing list