python 3.6 在idle中显示行数

1、下载LineNumbers.py

下载地址:http://idlex.sourceforge.net/download.html

python 当前行数 python怎么设置行数_压缩包

2、解压后复制

解压下载下来的压缩包,将里面的Linenumbers.py和configHandler.py复制到python的idle中:

python 当前行数 python怎么设置行数_压缩包_02


python 当前行数 python怎么设置行数_python_03


复制到python的idlelib目录下:

python 当前行数 python怎么设置行数_python 当前行数_04


python 当前行数 python怎么设置行数_python 当前行数_05

3、配置config-extensions.def文件

打开config-extensions.def文件,在末尾新增配置:

python 当前行数 python怎么设置行数_python 当前行数_06

[LineNumbers]
enable=True
enable_editor=True
enable_shell=False
visible=True
[LineNumbers_cfgBindings]
linenumbers-show=True

4、修改写入linenumber.py内容

python 当前行数 python怎么设置行数_压缩包_07


python 当前行数 python怎么设置行数_python_08


大写变小写是因为模块不一样。

5、重新打开idle

python 当前行数 python怎么设置行数_python 当前行数_09


行数正常显示。