Hi,

what is the portable way of accessing data files?


The doc suggests for onedir mode
   os.path.join(os.path.dirname(sys.executable), relativename))

but this code is not portable (won't run without pyinstaller),
whereas
   os.path.join(os.path.dirname(sys.argv[0]), relativename))

seems to look portable for me.

One file mode (which I never used su far) hower suggests:
   os.path.join(os.environ["_MEIPASS2], relativename))


How do others handle this?



thanks in advance for suggestions.
At the moment I tend to use sys.argv[0] as I don't use one file mode, but the 'official' way would interest me

--
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.

Reply via email to