[wxpython-users] [Half-OT]: Starting a compiled app on Linux

Paul McNett p at ulmcnett.com
Tue Sep 2 08:57:47 PDT 2008


Andrea Gavana wrote:
> Hi All,
> 
>     let's suppose for a moment that I have compiled a wxPython
> application into a Linux "executable" using cx_Freeze. If I go to the
> directory where the compiled app lives and double click on it (using
> the File Browser), it starts fine and it works. However, if I use the
> Linux terminal and simply type:
> 
> user at ubuntu8041:~/Desktop/GUI2Exe/samples/cx_Freeze$ wxapp
> 
> I get this message:
> 
> bash: wxapp: command not found
> 
> Huh? But it's there! And it also has all the permission in the
> universe (write/read/execute/playbasketball and whatever). Something
> similar happens when I try to start it from python using:
> 
> os.spawnl(os.P_NOWAIT, exeNam)
> 
> I get this:
> 
> Traceback (most recent call last):
>   File "<string>", line 6, in <module>
>   File "__main__.py", line 101, in <module>
> zipimport.ZipImportError: can't find module '__main____'
> 
> ... I am a bit puzzled... sorry for the very noob question, but what
> am I missing? What is the equivalent command for "double-click on a
> file" in Linux command line?
> 
> Thank you for your suggestions.

Unlike with Windows, the current directory is not in the path. This is a 
good thing. To execute a program in the current directory, you preface 
it with ./. So:

./wxapp

What you really want to do is put wxapp in a location that is in the 
path, such as /usr/local/bin. Then, from whatever directory, you can type:

wxapp

HTH!
Paul


More information about the wxpython-users mailing list