File opening

Salim Zayat zayats at blue.seas.upenn.edu
Wed Apr 3 16:17:44 EST 2002


Hey all.  I was wondering about opening files.  Now I know you need to 
include the path to the file in the open statement.  Now the problems 
arises here, though.  I am writing a module that reads in a config file 
and creates buttons from it.  So if my module is run directly, the only 
thing you need is 

> open('./buttons.config', 'r')

But if you wanna import the module, then the path to the open statement 
needs to be full path to the file.  Is there a fix to this?

Thanks!


Salim



More information about the Python-list mailing list