How to save custom preferences of python's IDLE?

亡梦爱人 提交于 2019-12-01 07:49:02

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/16628859/how-to-save-custom-preferences-of-pythons-idle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!