On Jun 6, 2:28 am, Franck Y <[EMAIL PROTECTED]> wrote: > I have a text file where there is > > xxx=value > yyy=value > zzz=value > etc... > > I would like use the from myfile import xxxx > > Since it has not the extension py how can i read it ? > I know the way to do it with the open file but i think this one is > easier...
I don't think you'll be able to use import unless you change the file extension to .py If you're in control of the text file and are confident it will only contain name=value pairs, try: execfile('your_file.txt') -- http://mail.python.org/mailman/listinfo/python-list