Python学习 --- 认识环境
时间:2021-09-02 15:54:04
收藏:0
阅读:15
学习享受开始:
打开IDLE(Python GUI) ,Ctrl+n 打开新的文件,输入
#NiceHexSpiral.py ? import turtle colors=[‘red‘,‘purple‘,‘blue‘,‘green‘,‘yellow‘,‘orange‘] t = turtle.Pen() turtle.bgcolor(‘black‘) for x in range(360): t.pencolor(colors[x%6]) t.width(x/100+1) t.forward(x) t.left(59)
Ctrl+s 保存为NiceHexSpiral.py,F5运行

Ok,完美。
发现IDLE 没有行号,解决:
1.直接使用IDLEX
Web 浏览器访问 http://idlex.sourceforge.net/extensions.html



解压


可以直接双击,进入

ctrl+n 打开新的文件,带有行号

2.或者原有Python 3.2 加上 LineNumbers.py
拷贝该位置的LineNumbers.py

到安装Python 3.2 的目录 E:\ProgramFiles\Python32\Lib\idlelib 下

在同目录的该文件

结尾添加
[LineNumbers]
enable=1
enable_editor=1
enable_shell=0
visible=True

保存该文件,重新打开IDLE即可显示行号

原文:https://www.cnblogs.com/d1012181765/p/15218101.html
评论(0)