2026年5月10日 星期日

Python GUI - - ( win10 ) 學習筆記 (四)

 Python GUI - - ( win10 ) 學習筆記 (四) 成功  


******************************************************

 Python GUI - - 學習筆記(成功   

2026-05-12  


這次在 Win11 環境 安裝 python 使用 python3.14  

python 3.14  

https://www.python.org/downloads/

安裝完 python ,因為自動加入路徑設定,需要重開機。

安裝完 python 即自帶 python IDLE ,可由開始功能表開啟。






貼上由 Gemini 生成的程式,可以執行!







******************************************************

 Python GUI - - PyQt6 學習筆記(三) 成功   

2025-02-04  

******************************************************

這次在 Win10 環境 再次安裝 python 使用 python3.12  

在Windows底下最適當安裝Python環境的方法

https://ithelp.ithome.com.tw/articles/10210071


python 3.12.8  

https://www.python.org/downloads/release/python-3128/

( 要依照上面教學來安裝 )


【Windows】Windows10 安裝 Anaconda 環境

Anaconda Navigator with Python 3.12  

https://www.anaconda.com/download/success





Anaconda Navigator --> jupyter notebook  

家中電腦錯誤不執行 (X) , 辦公室電腦執行 成功 ( O)  








Anaconda Navigator --> Spyder  

家中電腦執行後 kernel 錯誤 (X) , 辦公室電腦執行 成功 ( O)  








******************************************************


** 下載並安裝 PyCharm Community ( free 免費 )  
https://pycharm-community-edition.en.softonic.com/download
成功!

** PyCharm 安裝教學 (for Windows User)  
滿好的

** PyCharm 環境安裝全方位解說  
滿好的



** 書本範例

https://github.com/oxxostudio/book-code/blob/master/pyqt/ch01/code01.py


執行成功


PyQt6 與 tkinter 程式 都可以執行了!


** 下載並安裝 Qt Designer  

執行成功



** 在命令提示面 ( Anaconda Prompt ) 要安裝 PyQt6  

> pip install PyQt6

之後以指令將 *.ui 檔成 *.py 檔,

例如:

> pyuic6 -x test.ui -o test.py

> pyuic6 -x menu01.ui -o menu01.py


*.py 檔 就可以用 pyCharm 打開執行了



** 安裝 pyinstaller 將 python 程式 製作成 windows 執行檔   

安裝

  • pip install pyinstaller

執行

  • pyinstaller --onefile menu01.py  
  • pyinstaller --onefile --windowed menu01.py  

執行檔 輸出會放在 dist 子目錄

menu01.exe  執行 成功!  



** 安裝 py2exe 將 python 程式 製作成 windows 執行檔   

原則上,這是用一個視窗來執行 pyinstaller

You can install this project using PyPI:

$ pip install auto-py-to-exe

Then to run it, execute the following in the terminal:

$ auto-py-to-exe




執行檔 輸出會放在 output 子目錄

menu01.exe  執行 成功!  



讓 PC 像 Raspberry Pi 或 ESP32 一樣 連接 I2C / SPI / GPIO / UART 週邊裝置 

https://wei1234c.blogspot.com/2019/04/bridges-pc-raspberry-pi-esp32.html

模擬 Raspberry Pi 上的介面

# 在 PC 的環境下
from bridges.ftdi.adapters.rpi.RPi import GPIO 

GPIO.setmode(GPIO.BOARD)  # mode actuall doesn't  matter.
GPIO.setup(6, GPIO.OUT)

# 在 PC 的環境下
from bridges.ftdi.controllers.uart import UartController
ser = UartController().Serial() 

print(ser.name)        
ser.write(b'hello')     
ser.close()      





2026-05-12




沒有留言:

張貼留言

Dr. Shaw YC Shiau PhD 蕭醫師 蕭博士 蕭同學 首頁 置頂文 標籤 分類搜尋

There will be Advertisement  (personalized)   inserts in Google Blog. Sorry!  谷歌 的 部落格 會有 置入廣告 (個人化的) ,請見諒!    Information Service   b...