如何保存python的IDLE的自定义首选项? [英] How to save custom preferences of python's IDLE?

查看:175
本文介绍了如何保存python的IDLE的自定义首选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在不同的位置有几台计算机,尽管我没有使用IDLE进行编码,但它始终在后台运行,以进行小型测试,调试和研究任务. 我在家里配置了IDLE自定义突出显示,键集等,将我的设置保存到一个外部文件,并将这些设置安装到我正在使用的任何计算机上将非常方便.

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?

或者,如果有人知道IDLE将这些数据存储在什么地方,也可能会很好-也许我可以从那里复制文件.

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

提前谢谢!

推荐答案

IDLE将其首选项保存在$HOME/.idlerc目录中的多个文件中,并根据需要创建文件(例如,config-main.cfg).重要的文件至少是简单的文本文件,因此您应该能够将这些文件从一台计算机上的主目录复制到另一台计算机上.有一些潜在的陷阱需要提防:

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.

请注意,当前所有版本的IDLE(Python 2.7、3.2, 3.3等)共享相同的.idlerc目录和文件.除了目前为止,我目前还没有发现任何重大冲突 文件名带有需要Unicode的非ASCII字符的文件 表示形式:这可能会导致在IDLE 2.x和3.x之间共享问题.

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.

如果您尝试共享文件,另一个问题可能是行尾 Windows和非Windows系统之间切换.

Another issue might be line endings if you attempt to share files between Windows and non-Windows systems.

这篇关于如何保存python的IDLE的自定义首选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆