Orange Forum • View topic - Orange and py2exe?

Orange and py2exe?

A place to ask questions about methods in Orange and how they are used and other general support.

Orange and py2exe?

Postby Olexij » Sun May 01, 2005 11:01

is it possilble to package python application developed with orange to single executable via py2exe? Is it already done by someone?

Postby jurem » Wed May 04, 2005 15:08

yes it should work without any problems if your (python) dependencies are OK.
You have to write your own script and import py2exe module in it. When the script is ready you should call from command line:
Code: Select all
python py2exe

It will generate directory dist/ where it will be .exe file you want (and other related stuff).
Really quick example (not related directly to orange) would be:

< filename '' >
Code: Select all
import sys   # <-- py2exe knows it should put those modules with distribution of your
                    #       .exe file
print "Hello world!"
print "System information: "+sys.version

< end of>

< filename '' >
Code: Select all
import distutils,py2exe

setup(console=[""]) # <-- .exe will call file

< end of>

After 'python py2exe' you should have in dist/ directory hello.exe, which will output string from the script.
The same goes with orange, for example you could call script (in orange/OrangeCanvas directory) to run Orange Canvas from .exe file.

It was not tested very much yet, but in future we might put extra example for py2exe on orange web page.

Regards, Jure

Return to Questions & Support