Re: Reading a file in same directory as code with relative path

2005-11-18 Thread [EMAIL PROTECTED]
Answer to a similar question: http://groups.google.com/group/comp.lang.python/msg/c01f292d7926f393?hl=en&; If you want a way that will work regardless if your module is run interactively, imported, or just run by itself, this is a solution that will always work: :: \wherever\wherever\ (the d

Re: Reading a file in same directory as code with relative path

2005-11-17 Thread Bengt Richter
On 17 Nov 2005 17:29:55 -0800, [EMAIL PROTECTED] wrote: >I'm trying to read an XML file in the same directory as my python code, >using minidom: > >document = xml.dom.minidom.parse("data.xml") > >How can I read in the file "data.xml" without knowing it's full >path--just that it's in the same dire

Reading a file in same directory as code with relative path

2005-11-17 Thread dan . j . weber
I'm trying to read an XML file in the same directory as my python code, using minidom: document = xml.dom.minidom.parse("data.xml") How can I read in the file "data.xml" without knowing it's full path--just that it's in the same directory as my code file? Thanks for any help with this. I'm new to