python-pen 2.2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- python_pen/__init__.py +2 -0
- python_pen/core.py +1630 -0
- python_pen/title_pic.ico +0 -0
- python_pen-2.2.3.dist-info/METADATA +282 -0
- python_pen-2.2.3.dist-info/RECORD +8 -0
- python_pen-2.2.3.dist-info/WHEEL +5 -0
- python_pen-2.2.3.dist-info/licenses/LICENSE +21 -0
- python_pen-2.2.3.dist-info/top_level.txt +1 -0
python_pen/title_pic.ico
ADDED
|
Binary file
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: python_pen
|
|
3
|
+
Version: 2.2.3
|
|
4
|
+
Summary: A teaching-friendly Python drawing library based on turtle, designed for beginners.
|
|
5
|
+
Author-email: 11-year-old Coding Genius <pythonpen@example.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://pypi.org/project/python-pen/
|
|
8
|
+
Project-URL: Repository, https://pypi.org/project/python-pen/
|
|
9
|
+
Project-URL: Documentation, https://pypi.org/project/python-pen/
|
|
10
|
+
Keywords: turtle,drawing,education,teaching,beginner,python-pen,python_pen,chinese,bilingual
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Intended Audience :: Education
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Natural Language :: English
|
|
15
|
+
Classifier: Natural Language :: Chinese (Simplified)
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Topic :: Education
|
|
25
|
+
Classifier: Topic :: Multimedia :: Graphics
|
|
26
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
27
|
+
Requires-Python: >=3.8
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Dist: Pillow>=10.0
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# PythonPen — 让绘图像写字一样简单
|
|
34
|
+
|
|
35
|
+
> PythonPen is a lightweight drawing library that makes turtle graphics as easy as writing a sentence.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 📋 项目简介 / Introduction
|
|
40
|
+
|
|
41
|
+
**中文:**
|
|
42
|
+
PythonPen 是一个基于 Python `turtle` 的轻量级绘图库,专为初学者设计。
|
|
43
|
+
它把复杂的 turtle 操作封装成简单直观的**中英双语 API**,让你专注"画什么",而不是"怎么画"。
|
|
44
|
+
|
|
45
|
+
**English:**
|
|
46
|
+
PythonPen is a lightweight drawing library built on Python's `turtle` module, designed for beginners.
|
|
47
|
+
It wraps complex turtle operations into simple, intuitive **bilingual (Chinese/English) APIs**, so you can focus on *what* to draw, not *how*.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 👤 作者 / Author
|
|
52
|
+
|
|
53
|
+
| 项目 / Item | 内容 / Value |
|
|
54
|
+
|---|---|
|
|
55
|
+
| 姓名 / Name | 11 岁的小程序员 / 11-year-old Coding Genius |
|
|
56
|
+
| 版本 / Version | **v2.2.2** |
|
|
57
|
+
| 更新日期 / Updated | 2026-08-20 |
|
|
58
|
+
| Python 版本 / Python | 3.8+(推荐 3.13+) |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 📁 目录结构 / File Structure
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
PythonPenProject/ ← 项目根目录
|
|
66
|
+
├── README.md ← 你正在看的这个文件
|
|
67
|
+
├── CHANGELOG.md ← 更新日志
|
|
68
|
+
├── demo.py ← 主演示程序(推荐从这里运行)
|
|
69
|
+
│
|
|
70
|
+
├── PythonPen/ ← 核心库文件夹
|
|
71
|
+
│ ├── __init__.py ← 库入口
|
|
72
|
+
│ ├── core.py ← 核心实现(Pen 类)
|
|
73
|
+
│ └── title_pic.ico ← 内置铅笔图标
|
|
74
|
+
│
|
|
75
|
+
└── icon_helper/ ← 图标急救包(可选)
|
|
76
|
+
├── README.txt ← 图标问题说明书
|
|
77
|
+
├── make_icon.py ← 生成标准 ICO
|
|
78
|
+
├── fix_icon.py ← 修复 ICO 尺寸
|
|
79
|
+
├── check_icon.py ← 检查 ICO 内容
|
|
80
|
+
└── clean.py ← 清理缓存
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 🚀 安装 / Installation
|
|
86
|
+
|
|
87
|
+
> PythonPen **不需要** `pip install`,纯绿色,解压即用。
|
|
88
|
+
|
|
89
|
+
**中文:**
|
|
90
|
+
1. 确保已安装 Python 3.8 或更高版本
|
|
91
|
+
2. 把整个 `PythonPenProject` 文件夹放在任意位置
|
|
92
|
+
3. 在 `PythonPenProject` 目录下运行代码即可
|
|
93
|
+
|
|
94
|
+
**English:**
|
|
95
|
+
1. Make sure Python 3.8+ is installed
|
|
96
|
+
2. Place the entire `PythonPenProject` folder anywhere
|
|
97
|
+
3. Run your code from inside the `PythonPenProject` directory
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## ⚡ 快速开始 / Quick Start
|
|
102
|
+
|
|
103
|
+
打开终端,进入项目目录:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
cd PythonPenProject
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
运行主演示程序:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
python demo.py
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
你会看到 / You will see:
|
|
116
|
+
- ✅ 一个绘图窗口弹出 / A drawing window pops up
|
|
117
|
+
- ✅ 窗口显示 PythonPen 图标 / PythonPen icon in the title bar
|
|
118
|
+
- ✅ 依次展示 5 个演示场景 / 5 demo scenes play in sequence
|
|
119
|
+
- ✅ 点击窗口关闭 / Click the window to exit
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## 📖 基本用法 / Basic Usage
|
|
124
|
+
|
|
125
|
+
### 中文模式(默认)/ Chinese Mode (Default)
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
from PythonPen import Pen
|
|
129
|
+
|
|
130
|
+
pen = Pen(lang="ch")
|
|
131
|
+
pen.pen_forward(100)
|
|
132
|
+
pen.pen_right(90)
|
|
133
|
+
pen.draw_circle(50)
|
|
134
|
+
pen.screen_exitonclick()
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### English Mode
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
from PythonPen import Pen
|
|
141
|
+
|
|
142
|
+
pen = Pen(lang="en")
|
|
143
|
+
pen.pen_forward(100)
|
|
144
|
+
pen.pen_right(90)
|
|
145
|
+
pen.draw_circle(50)
|
|
146
|
+
pen.screen_exitonclick()
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### 不使用内置图标 / Disable Built-in Icon
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
pen = Pen(lang="ch", use_default_icon=False)
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### 使用自定义图标 / Use Custom Icon
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
pen = Pen(lang="ch", use_default_icon=False)
|
|
159
|
+
pen.set_icon(r"C:\path\to\your_icon.ico")
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 🎨 内置功能一览 / Feature Reference
|
|
165
|
+
|
|
166
|
+
### 📋 数学常量 / Math Constants
|
|
167
|
+
```
|
|
168
|
+
self.E, self.I, self.PI, self.PHI, self.SQRT2
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### 🎨 基础控制 / Basic Control
|
|
172
|
+
```
|
|
173
|
+
bg, style, set_icon, lang
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### 🚀 画笔移动 / Pen Movement
|
|
177
|
+
```
|
|
178
|
+
pen_forward, pen_backward, pen_left, pen_right
|
|
179
|
+
pen_goto, pen_home, pen_setheading
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### 📍 画布与状态 / Canvas & State
|
|
183
|
+
```
|
|
184
|
+
pen_clear, pen_reset, pen_pos
|
|
185
|
+
pen_save_state, pen_restore_state
|
|
186
|
+
pen_tracer, pen_update
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### 🖊️ 文本与交互 / Text & Interaction
|
|
190
|
+
```
|
|
191
|
+
pen_write, pen_stamp, pen_clear_stamp
|
|
192
|
+
pen_num_input, pen_text_input
|
|
193
|
+
pen_set_title, pen_delay
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### 🌈 时间与颜色 / Time & Color
|
|
197
|
+
```
|
|
198
|
+
show_detailed_time, set_color_mode, get_color_mode
|
|
199
|
+
random_color, random_int, random_float
|
|
200
|
+
random_choice, random_shuffled
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### ▣ 窗口控制 / Window Control
|
|
204
|
+
```
|
|
205
|
+
screen_exitonclick, screen_mainloop, screen_bye
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### 🔺 基础图形 / Basic Shapes
|
|
209
|
+
```
|
|
210
|
+
draw_circle, draw_square, draw_rectangle
|
|
211
|
+
draw_equilateral_triangle, draw_isosceles_triangle
|
|
212
|
+
draw_polygon
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### 🔷 高级图形 / Advanced Shapes
|
|
216
|
+
```
|
|
217
|
+
draw_star, draw_python_logo
|
|
218
|
+
draw_colorful_spiral, draw_rainbow
|
|
219
|
+
draw_maze, draw_random_art
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### 🎯 工具与扩展 / Utilities
|
|
223
|
+
```
|
|
224
|
+
drawing_challenge, help
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## 🖼️ 图标问题?/ Icon Issues?
|
|
230
|
+
|
|
231
|
+
如果你发现图标不显示、是灰色的、或改了没变化,请查看:
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
icon_helper/README.txt
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
里面有一整套工具,专门解决图标问题。
|
|
238
|
+
The `icon_helper/` folder contains a complete toolkit for icon troubleshooting.
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## 💡 设计理念 / Design Philosophy
|
|
243
|
+
|
|
244
|
+
| # | 中文 | English |
|
|
245
|
+
|---|---|---|
|
|
246
|
+
| 1 | **简单优先** — API 直觉化,零门槛上手 | **Simplicity First** — Intuitive APIs, zero learning curve |
|
|
247
|
+
| 2 | **双语支持** — 中英文无缝切换 | **Bilingual** — Seamless Chinese/English switching |
|
|
248
|
+
| 3 | **零依赖** — 仅用标准库,无需 pip | **Zero Dependencies** — Standard library only |
|
|
249
|
+
| 4 | **优雅退出** — 窗口关闭不报错 | **Graceful Exit** — No errors on window close |
|
|
250
|
+
| 5 | **用户可控** — 图标、语言、样式全可选 | **User Empowerment** — Icon, language, style all optional |
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## 🙏 致谢 / Acknowledgements
|
|
255
|
+
|
|
256
|
+
**中文:**
|
|
257
|
+
感谢 Python `turtle` 模块,
|
|
258
|
+
感谢所有帮助测试的人,
|
|
259
|
+
感谢每一个用代码创造美好的你。
|
|
260
|
+
|
|
261
|
+
**English:**
|
|
262
|
+
Thanks to the Python `turtle` module,
|
|
263
|
+
thanks to everyone who helped test,
|
|
264
|
+
and thanks to **you** — creating beauty with code.
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## 📄 License
|
|
269
|
+
|
|
270
|
+
MIT License — 随便用,随便改,注明出处就行。
|
|
271
|
+
MIT License — Free to use, modify, and share. Just keep the attribution.
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
<div align="center">
|
|
276
|
+
|
|
277
|
+
**"代码是写给人看的,顺便给机器执行。"**
|
|
278
|
+
*"Code is written for humans, machines just happen to run it."*
|
|
279
|
+
|
|
280
|
+
🖤🐢 **PythonPen v2.2.3** — by 11-year-old Coding Genius
|
|
281
|
+
|
|
282
|
+
</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
python_pen/__init__.py,sha256=NFYGFIkWDSFEZlOGy-JqwLAQS9xQSYcxcyOd5KjBrLU,44
|
|
2
|
+
python_pen/core.py,sha256=GrJxWXM6yRnmvhkkptogSHejRqVMVreXhL_aZr0s9PM,65031
|
|
3
|
+
python_pen/title_pic.ico,sha256=TAWnuuLVRF8NJqdH23dGGWQPw9K5o8obfqj76_DxgyA,6514
|
|
4
|
+
python_pen-2.2.3.dist-info/licenses/LICENSE,sha256=Laz5vfhOje5NNcF257NJHM17RKwPp83qr4uV0S0LX7Q,1101
|
|
5
|
+
python_pen-2.2.3.dist-info/METADATA,sha256=aU2A6_siu4LwxiFNKm3ONsQwkf3TZO1F_iSe0OJkjS8,8100
|
|
6
|
+
python_pen-2.2.3.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
7
|
+
python_pen-2.2.3.dist-info/top_level.txt,sha256=pYbbHZOjQKHL8s2hKlYvmaZG8-AqM4-8GPDra3PDYuM,11
|
|
8
|
+
python_pen-2.2.3.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 11-year-old Coding Genius
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
python_pen
|