下载 Python 3.9.17 的源码

 

下载 Python 3.9.17 源码

cd ~
wget https://www.python.org/ftp/python/3.9.17/Python-3.9.17.tgz
tar -xzf Python-3.9.17.tgz
cd Python-3.9.17

  

镜像源下载命令
清华大学镜像源(同步快、推荐) wget https://mirrors.tuna.tsinghua.edu.cn/python/3.9.17/Python-3.9.17.tgz
阿里云镜像源(稳定性高) wget https://mirrors.aliyun.com/python-releases/python/3.9.17/Python-3.9.17.tgz
中国科学技术大学镜像源(教育网友好) wget https://mirrors.ustc.edu.cn/python/3.9.17/Python-3.9.17.tgz

 

# 替换为你电脑上文件的路径和灵芯派的IP
scp /本地文件路径/Python-3.9.17.tgz zmrobo@灵芯派IP:/home/zmrobo

  

python3.9 -m pip install tk --user
 
 
python3.9 -m pip install tk --user -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn
 
 
python3.9 -c "import tkinter; print('✅ Tkinter 导入成功!')"

  

import tkinter as tk
from tkinter import ttk

# 创建主窗口
root = tk.Tk()
root.title("灵芯派 0 号屏幕测试")

# 设置窗口大小和位置
# 灵芯派的屏幕分辨率通常为 800x480,可根据实际情况调整
root.geometry("800x480+0+0")  # 宽x高+x偏移+y偏移(0,0 表示左上角)

# 设置窗口背景色
root.configure(bg="#f0f0f0")

# 添加标签控件
label = ttk.Label(
    root,
    text="欢迎使用灵芯派!\n这是一个简单的 Tkinter 程序。",
    font=("Arial", 20, "bold"),
    foreground="#333333",
    background="#f0f0f0"
)
label.pack(pady=50)  # 设置上下边距

# 添加按钮控件
def on_button_click():
    label.config(text="按钮已点击!")

button = ttk.Button(
    root,
    text="点击我",
    command=on_button_click,
    width=20
)
button.pack(pady=20)

# 启动主循环
root.mainloop()

 

 

posted @ 2025-11-24 16:02  aiplus  阅读(0)  评论(0)    收藏  举报
悬浮按钮示例