# 用 Python 製作一個應用程式 ###### 作者:阿杰 ### 安裝套件 :::spoiler **安裝pygame** > 通過pip安裝auto-py-to-exe: > ```t > pip install pygame > ``` ::: :::spoiler **安裝pyinstaller** > 通過pip安裝pyinstaller: > ```t > pip install pyinstaller > ``` > 如果失敗可以使用以下的方法進行安裝: > ```t > pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz > ``` ::: :::spoiler **安裝auto-py-to-exe** > 通過pip安裝auto-py-to-exe: > ```t > pip install auto-py-to-exe > ``` ::: ### 什麼是 pip? > pip 就是 python 內建的 "套件安裝跟管理的工具" > 想要使用這個工具 我們只要在 "小黑"(命令提示字元) 打上 pip 就可以了 > 因為我們今天是要 安裝套件 > 所以我們可以打 [【Python教學】pip install 指令大全](https://www.maxlist.xyz/2019/07/13/pip-install-python/) ## Pygame Pygame教學: [Pygame-入門介紹](https://hackmd.io/@andy010629/r103KC6Iv) ## Python執行檔打包成exe檔 ### 用 pyinstaller 打包成exe檔 Windows 用戶執行`pyinstaller -F .\hello.py`,會在命令框內發現缺陷。 mac 用戶則是執行`pyinstaller -F ./hello.py`,因為命令行是正斜線。 這個指令可以讓打包出來.exe執行檔的執行窗隱藏,而且執行檔的應用圖示是自己選的圖: `pyinstaller -F -w py檔路徑 -i 圖路徑` pyinstaller教學1:[【Python】使用PyInstaller將Python打包成exe檔](https://medium.com/pyladies-taiwan/python-%E5%B0%87python%E6%89%93%E5%8C%85%E6%88%90exe%E6%AA%94-32a4bacbe351) pyinstaller教學2: [Pyinstaller 使用+打包圖片方法](https://www.itread01.com/content/1544898606.html) ### 用 auto-py-to-exe 打包成exe檔 在命令提示字元執行`auto-py-to-exe` Auto-Py-to-Exe教學: [Auto-Py-to-Exe完美打包python程序](https://zhuanlan.zhihu.com/p/130328237) ###### tags: `Python`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up