在OS X 10.8上从Python打开窗口时出现烦人的消息 [英] Annoying message when opening windows from Python on OS X 10.8

查看:462
本文介绍了在OS X 10.8上从Python打开窗口时出现烦人的消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我运行在OS X 10.8上打开任何类型窗口的Python脚本时,无论是GLUT窗口还是QT窗口或其他任何东西,我都会收到一条如下所示的消息:

Whenever I run a Python script that opens any kind of window on OS X 10.8, whether it's a GLUT window or a QT one or anything else, I get a message that looks like this:

2013-09-11 14:36:53.321 Python[3027:f07] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/0x/25_70mj17tb1ypm1c_js8jd40000gq/T/org.python.python.savedState

我使用通过MacPorts安装的python2.7.

I use python2.7 installed via MacPorts.

这是一个小麻烦,但是我很好奇知道消息的含义,以及是否可以采取任何措施来阻止它.是因为我的系统配置错误,还是每个人都明白了?

This is a minor annoyance, but I'm curious to know what the message means, and whether there's anything I can do to prevent it. Is it due to a misconfiguration of my system, or does everyone get this?

推荐答案

感谢@Steve Barnes给我一个提示,回答了我自己的问题.看来可以使用终端命令解决此问题

Answering my own question, with thanks to @Steve Barnes for giving me a hint. It seems this problem can be solved with the terminal command

$ defaults write org.python.python ApplePersistenceIgnoreState NO

我不确定该命令的确切功能,但是前一段时间我没有发现任何不良影响.

I am not sure exactly what this command does, but having done it some time ago I have observed no ill effects.

但是请注意,另一位用户指出,这可能会在山狮上引起python 3.4的错误,即按下按钮时,tkinter对话框不会关闭.

Note however, that another user has pointed out that this can cause a bug with python 3.4 on mountain lion where tkinter dialogs do not close when a button is pressed as one would expect.

$ defaults write org.python.python ApplePersistenceIgnoreState YES

如果遇到问题,将撤消该命令.

will undo the command if you experience problems.

这篇关于在OS X 10.8上从Python打开窗口时出现烦人的消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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