Hello All,

I could be wrong, but I think sys._MEIPASS is more reliable than sys.argv[0]. When you use sys._MEIPASS, it works in both --onedir and --onefile mode (I am sure of that). When you use sys.argv[0], it definitely works in --onedir mode but I have had trouble in --onefile mode.

Keep sys._MEIPASS in the manual, I say.

Zak Fallows

On 5/10/13 11:26 AM, David Cortesi wrote:
This is what I've got in the manual, do you think
sys.argv[0] is more correct?

    if getattr(sys, 'frozen', False):
        # we are running in a PyInstaller bundle
        basedir = sys._MEIPASS
    else:
        # we are running in a normal Python environment
        basedir = os.path.dirname(__file__)


--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to