open file on mac

tinauser tinauser at
Fri Oct 8 16:16:13 CEST 2010

hi, sorry if it is a stupid qustio,but i cannot figure out where's the
i've a simpleModule:
class Starter:
    def init(self,num):
        print "hithere!"
        print "the answer is ",num
        import sys,os
        print "path:",sys.path

            #f = open("/Users/lguerrasio/myfold/",'r')
            f = open("",'r')
            print "huurray!"
        except IOError:
            print "The file does not exist, exiting gracefully"
        print "This line will always print"

The module is located in the same folder of
now,from terminal I import sys and add to the path the folder /Users/
lguerrasio/myfold; the I import the module and execute

on mac I get an error if i do not give the full path of
(commented out in the code above);
on windows i did not have this problem.
Am I missing anything?

More information about the Python-list mailing list