2.cd c:\pyinstaller-2.1
執行python pyinstaller.py
若出現如下錯誤,則需要安裝pywin32-218.win32-py2.7.exe
3.繼續執行python pyinstaller.py
若出現以下現象,則成功
方式一
cd c:\pyinstaller-2.1
執行python pyinstaller.py -f c:\users\gyp\desktop\test\test.py
其中c:\users\gyp\desktop\test\test.py是我要轉換的那個測試檔案,注意路徑要寫對!
紅框裡是生成檔案的路徑。找到該檔案雙擊執行,就可以了。
加圖示
c:\pyinstaller-2.1>python pyinstaller.py -f c:\users\gyp\desktop\test\test.py -i c:\users\gyp\desktop\test\1.ico
其中c:\users\gyp\desktop\test\test.py,c:\users\gyp\desktop\test\1.ico是我要轉換的那個測試檔案和要加的圖示。
方式二(建議使用)
將測試資料夾放到pyinstaller-2.1.zip的解壓目錄,cmd進入到測試資料夾
cd c:\pyinstaller-2.1\test
加圖示
紅框裡是生成檔案的路徑。找到該檔案雙擊執行,就可以了。
-f, –onefile py**只有乙個檔案
-d, –onedir py**放在乙個目錄中(預設是這個)
-k, –tk 包含tcl/tk
-d, –debug 生成debug模式的exe檔案
-w, –windowed, –noconsole 窗體exe檔案(windows only)
-c, –nowindowed, –console 控制台exe檔案(windows only)
-x, –upx 使用upx壓縮exe檔案
-o dir, –out=dir 設定spec檔案輸出的目錄,預設在pyinstaller同目錄
-icon= 加入圖示(windows only)
-v file, –version=file 加入版本資訊檔案
8 打包和壓縮
1.gzip壓縮 gzip a.txt 2.解壓 gunzip a.txt.gz gzip d a.txt.gz 3.bzip2壓縮 bzip2 a 4.解壓 bunzip2 a.bz2 bzip2 d a.bz2 5.將當前目錄的檔案打包 tar cvf bak.tar 將 etc passwor...
10 打包與壓縮
1.gzip壓縮 gzip a.txt 2.解壓 gunzip a.txt.gz gzip d a.txt.gz 3.bzip2壓縮 bzip2 a 4.解壓 bunzip2 a.bz2 bzip2 d a.bz2 5.將當前目錄的檔案打包 tar cvf bak.tar 將 etc passwor...
Linux指令(六) 打包
壓縮指令 z compress程式壓縮的檔案 bz2 bzip2程式壓縮的檔案 gz gzip程式壓縮的檔案 tar tar程式打包的檔案,沒有經過壓縮 tar.gz tar程式打包的檔案,且經過gzip的壓縮 壓縮指令,檢視壓縮檔案指令 bzip2,bzcat gzip,zcat gzip d 為...