python idle保存不了,如何保存python IDLE的自定义首选项?

IDLE将用户偏好保存在$HOME/.idlerc目录下的文件中,如config-main.cfg。要迁移这些设置,确保IDLE未运行,然后复制该目录下的文本文件到另一台机器的相应目录。注意可能存在的兼容性问题,比如非ASCII字符文件名和不同系统的行结束符差异。
摘要由CSDN通过智能技术生成

I have several computers at different locations, and although I'm not coding in IDLE, it is always running in the background, for small testing, debugging and researching tasks.

I configured IDLE custom highlighting, key set, etc. at home, and it would be pretty comfy to save my settings into an external file, and install these settings onto any machines I'm working on.

So my question: is there a way to do that?

Or it would be also nice, if anyone knows where IDLE stores these datas — probably I can copy the file(s) from there..

Thanks in advance!

解决方案

IDLE saves its preferences in several files in the $HOME/.idlerc directory, creating the files (for example, config-main.cfg) as needed. The important ones, at least, are simple text files so you should be able to copy those files from your home directory on one machine to another. There are a few potential gotcha's to watch out for:

When you copy the files to another home directory, make sure no IDLE

instances are running.

Be aware that currently all versions of IDLE (with Python 2.7, 3.2,

3.3, etc) share the same .idlerc directory and files. I'm not aware of any major conflicts at this point other than possibly recent

files with file names with non-ASCII characters that require Unicode

representation: that could cause problems sharing between IDLE 2.x and 3.x.

Another issue might be line endings if you attempt to share files

between Windows and non-Windows systems.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值