Comment 7 for bug 510642

Revision history for this message
Kevin Mac (knifethemac) wrote :

That's a great find. Yeah that should work for all the *nix OSes. I can't recall enough about Windows to be sure it works on all of those.

I did manage to find the WX call I was thinking about.
You're solution will be much cleaner, but I'll go ahead and repeat what I found in this post in the slight chance that your fix doesn't work in every case.

#####################################################################

Here's the WX call I was thinking about:

---------------------------------------------
wxStandardPaths::GetExecutablePath

wxString GetExecutablePath() const

Return the directory and the filename for the current executable.

Example return values:

    * Unix: /usr/local/bin/exename
    * Windows: C:\Programs\AppFolder\exename.exe
    * Mac: /Programs/exename
---------------------------------------------

I tried

wx.StandardPaths.Get().GetExecutablePath()

and it returns /usr/bin/python2.5 when running interpreted.

I didn't have time to try the compilation tutorial yet, so I'm
not certain what it returns in that case. But, It looks promising.
Unfortunately it would mean more conditional code for the interpreted
version vs. the compiled version.

Note that the extra ".Get()" is a static function so that an
instance of StandardPaths doesn't need to be created.