At Sunday 27/8/2006 18:35, [EMAIL PROTECTED] wrote:
(This code don't even compile...!)
def simplecsdtoorc(filename):
file = open(filename,"r")
file is not a good name - hides the builtin type of the same name.
Same for dict, list...
alllines = file.read_until("</CsInstruments>")
read_until???
pattern1 = re.compile("</")
orcfilename = filename[-3:] + "orc"
perhaps you want filename[:-3]+"orc"?
for line in alllines:
if not pattern1
if not pattern1.search(line):
print >>orcfilename, line
Open the output file before the loop, and use its write() method here
I am pretty sure my code isn't close to what I want. I need to be able
to skip html like commands from <defined> to <undefined> and to key on
another word in adition to </CsInstruments> to end the routine
Good job for Beautiful Soup: http://www.crummy.com/software/BeautifulSoup/
Gabriel Genellina
Softlab SRL
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
--
http://mail.python.org/mailman/listinfo/python-list