python compiled into exe file

Recently more and more I like to use python to write tools. When in use, the program found that internal members often different python installation directory, if you double-execution with bat, often need to modify the path down from the svn down the bat file python.exe of. And to planning, art or QA use, but also need to let them install python and a variety of plug-ins, they can put you sick. Therefore, we must turn to py files into exe file, and then double-click to achieve fool-style execution. I learned that there are two commonly used kits: py2exe and pyinstaller, my choices are pyinstaller. Here's how to use the recording. I. First, download the official website, http: //www.pyinstaller.org/, it recommended 32 version 2.7, and unzip it. Second, the use doc / Manual.html was written in great detail, here briefly about the most basic, commonly used functions. 1. cmd into the next decompression pyinstaller directory, execute the command format is as follows: python pyinstaller.py [opts] program.py several common options include: -D, --onedir create a directory that contains files and dependencies exe file, which is The default option. (Create a folder name containing an executable name and all support files. This is the default.) -F, --onefile create an exe file, all dependent files are packaged into the exe file, exe this will be relatively large, but I easy to use feel. (Create a single executable file name (or name .exe or name .app).) -C, --console, --nowindowed console, no interface, the default option. (Set up a console subsystem for standard input / output at run time. This is the default for both one-file and one-folder modes.) -W, --windowed, --noconsole no console window. (On Windows and Mac OS X, do not create a console window at run time for standard input / output. (This option is ignored for other operating systems.) On Mac OS X, this option triggers the creation of an OS X application bundle .) For example: D: \ soft \ python \ PyInstaller-2.1> python pyinstaller.py -c -FE: \ work \ unity \ xxx \ trunk \ tools \ excel2json \ excel2json.py given, dependent on the pywin32 pywin32 2. installation. http://sourceforge.net/projects/pywin32/files/pywin32/, after downloading double-click install. 3. Again cmd under execution, D: \ soft \ python \ PyInstaller-2.1> python pyinstaller.py -c -FE: \ work \ unity \ xxx \ trunk \ tools \ excel2json \ excel2json.py. Successfully generated exe! do not create a console window at run time for standard input / output (This option is ignored for other operating systems.) On Mac OS X, this option triggers the creation of an OS X application bundle) such as:.. D: \ soft \ python \ PyInstaller-2.1> python pyinstaller.py -c -FE: \ work \ unity \ xxx \ trunk \ tools \ excel2json \ excel2json.py given, dependent pywin32 2. installation pywin32. http://sourceforge.net/projects/pywin32/files/pywin32/, after downloading double-click install. 3. Again cmd under execution, D: \ soft \ python \ PyInstaller-2.1> python pyinstaller.py -c -FE: \ work \ unity \ xxx \ trunk \ tools \ excel2json \ excel2json.py. Successfully generated exe! do not create a console window at run time for standard input / output (This option is ignored for other operating systems.) On Mac OS X, this option triggers the creation of an OS X application bundle) such as:.. D: \ soft \ python \ PyInstaller-2.1> python pyinstaller.py -c -FE: \ work \ unity \ xxx \ trunk \ tools \ excel2json \ excel2json.py given, dependent pywin32 2. installation pywin32. http://sourceforge.net/projects/pywin32/files/pywin32/, after downloading double-click install. 3. Again cmd under execution, D: \ soft \ python \ PyInstaller-2.1> python pyinstaller.py -c -FE: \ work \ unity \ xxx \ trunk \ tools \ excel2json \ excel2json.py. Successfully generated exe! py -c -FE: \ work \ unity \ xxx \ trunk \ tools \ excel2json \ excel2json.py error, depend pywin32 2. Installation pywin32. http://sourceforge.net/projects/pywin32/files/pywin32/, after downloading double-click install. 3. Again cmd under execution, D: \ soft \ python \ PyInstaller-2.1> python pyinstaller.py -c -FE: \ work \ unity \ xxx \ trunk \ tools \ excel2json \ excel2json.py. Successfully generated exe! py -c -FE: \ work \ unity \ xxx \ trunk \ tools \ excel2json \ excel2json.py error, depend pywin32 2. Installation pywin32. http://sourceforge.net/projects/pywin32/files/pywin32/, after downloading double-click install. 3. Again cmd under execution, D: \ soft \ python \ PyInstaller-2.1> python pyinstaller.py -c -FE: \ work \ unity \ xxx \ trunk \ tools \ excel2json \ excel2json.py. Successfully generated exe!

Guess you like

Origin www.cnblogs.com/cxcjhk/p/11701387.html