J'ai fait une recherche et j'ai trouvé qu'il y avait des compilateurs
pour les fichiers .py qui donnent des executables indépendants de
python qui peuvent théoriquement marcher sur windows...malheureusement
je viens de commencer python et je ne comprends pas du tout où je me
plante mais je sais que ça plante:
Je roule sur python 2.4.2
j'ai essayer py2exe :
py2exe-0.6.3.win32-py2.4.exe
ça me disait de faire un fichier setup.py pour compiler mon_script.py
bon j'ai donc essayer de suivre les directives et le résultat:
//Traceback (most recent call last):
File "C:\_dossier_non_mentionné_\setup.py", line 9, in -toplevel-
console=["C:\001.py"]
File "C:\_dossier_non_mentionné_\Python24\lib\distutils\core.py", line 137, in setup
raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
SystemExit: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: no commands supplied//
Est ce que l'un de vous saurait quoi faire pour parer à ce problème? merci d'avance!
[ Lien ]
////////// --http://www.py2exe.org/:
Assuming you have written a python script myscript.py which you
want to convert into an executable windows program, able to run on
systems without a python installation. If you don't already have
written a distutils setup-script, write one, and insert the
statement import py2exe before the call to the setup function:
# setup.py
from distutils.core import setup
import py2exe
setup(console=["myscript.py"])
Running
python setup.py py2exe --help
will display all available command-line flags to the py2exe
command.
Now you can call the setup script like in this way:
python setup.py py2exe
and a subdirectory dist will be created, containing the files
myscript.exe, python23.dll, and library.zip. If your script
uses compiled C extension modules, they will be copied here as well,
also all dlls needed at runtime (except the system dlls).
These files include everything that is needed for your program, and
you should distribute the whole directory contents.
The above setup script creates a console program, if you want a GUI
program without the console window, simply replace
console=["myscript.py"] with windows=["myscript.py"].
py2exe can create more than one exe file in one run, this is
useful if you have a couple of related scripts. Pass a list of all
scripts in the console and/or windows keyword argument.
---//////
One step away from ...