- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
一旦我关闭 tk-window 实例a
,以下几行就会导致 ipython 崩溃。
import visual, Tkinter
a = Tkinter.Tk()
a.update()
display = visual.display(title = "Hallo")
display.exit = 0
visual.sphere()
如果我先关闭视觉显示,整个终端就会崩溃。我在 kubuntu 8.10 上运行一切。这是一个错误还是我做错了什么?如果这是一个错误:有没有聪明的方法来避免它?
干杯,菲利普
最佳答案
您是否尝试过使用 -gthread -tk
命令行开关启动 ipython?
来自ipython --help
:
-gthread, -qthread, -q4thread, -wthread, -pylab Only ONE of these can be given, and it can only be given as the first option passed to IPython (it will have no effect in any other position). They provide threading support for the GTK, QT and WXWidgets toolkits, and for the matplotlib library. With any of the first four options, IPython starts running a separate thread for the graphical toolkit's operation, so that you can open and control graphical elements from within an IPython command line, without blocking. All four provide essentially the same functionality, respectively for GTK, QT3, QT4 and WXWidgets (via their Python interfaces). Note that with -wthread, you can additionally use the -wxversion option to request a specific version of wx to be used. This requires that you have the 'wxversion' Python module installed, which is part of recent wxPython distributions. If -pylab is given, IPython loads special support for the mat- plotlib library (http://matplotlib.sourceforge.net), allowing interactive usage of any of its backends as defined in the user's .matplotlibrc file. It automatically activates GTK, QT or WX threading for IPyhton if the choice of matplotlib backend requires it. It also modifies the %run command to correctly execute (without blocking) any matplotlib-based script which calls show() at the end. -tk The -g/q/q4/wthread options, and -pylab (if matplotlib is configured to use GTK, QT or WX), will normally block Tk graphical interfaces. This means that when GTK, QT or WX threading is active, any attempt to open a Tk GUI will result in a dead window, and possibly cause the Python interpreter to crash. An extra option, -tk, is available to address this issue. It can ONLY be given as a SECOND option after any of the above (-gthread, -qthread, q4thread, -wthread or -pylab). If -tk is given, IPython will try to coordinate Tk threading with GTK, QT or WX. This is however potentially unreliable, and you will have to test on your platform and Python configuration to determine whether it works for you. Debian users have reported success, apparently due to the fact that Debian builds all of Tcl, Tk, Tkinter and Python with pthreads support. Under other Linux environments (such as Fedora Core 2/3), this option has caused random crashes and lockups of the Python interpreter. Under other operating systems (Mac OSX and Windows), you'll need to try it to find out, since currently no user reports are available. There is unfortunately no way for IPython to determine at run- time whether -tk will work reliably or not, so you will need to do some experiments before relying on it for regular work.
关于python - 如何避免Tkinter、Visual、iPython引起的Gdk-ERROR?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/792816/
我正在尝试从par_iter()内部捕捉到 panic ,并继续执行par_iter块之后的操作。 如果我有这个,我会正确地获得一切,并且不会出现 panic : let dog: Dog = Dog
我可以假设从 JDK 类加载机制抛出的每个 NoClassDefFoundError 总是在堆栈跟踪中将 ClassNotFoundException 作为原因吗? 另外,NoClassDefFoun
我有下面的程序 package com; import java.io.PrintStream; import java.net.URL; import java.net.UR
我有一些由另一组人编写的简单代码(目前不可用),它引用了我得到的一些 jar 文件。当我编译代码时,一切都构建得很好,但是一旦代码尝试创建在其中一个 jar 文件中定义的类的实例,我就会收到 java
我正在尝试按照 https://github.com/airbrake/airbrake-django#manually-sending-errors-to-airbrake 上的示例进行操作手动向
我不确定为什么这是递归的。 jTable1.getModel().addTableModelListener(new TableModelListener() { public void table
我按照 https://github.com/cloudfoundry/vcap 上的自述文件进行操作 它应该工作正常... 但我得到了这样的错误: 有谁知道发生了什么? 我在 Ubuntu10.04
我只是想知道当你有 UI-Router 的空白页面时,有人知道如何调试情况。 (当然,控制台没有任何错误) 通过为路由器事件执行 console.log(取自 here),我发现它进入了正确的状态,但
我们的网站上有一个问题,一些 Firefox 用户在访问我们的网站时会收到“错误请求”消息(仅此而已,只是“错误请求”字样!) 这似乎是由于 google 跟踪 cookie 损坏,可能是 __utm
在使用guard-rspec在Rails 4项目中运行guard时,在vim中打开/关闭文件时偶尔会看到以下错误。我试过升级/降级guard,guard-rspec,pry和其他没有运气的库。 rub
今天我在编写程序时遇到了这个错误。 Caused by:java.lang.ClassCastException: org.cubeville.blocks.CrossedBlockBrush can
我在执行应用程序时遇到空指针异常,但我不确定原因。问题发生在线路上: task.execute(""); 但我不确定为什么会出现空指针异常。 (我已经验证我有互联网连接,并且它所连接的 XML
嗨,我有一个 java 应用程序,我正在尝试使用它写入 tempDir,但我仍然遇到以下异常。我承认我对编写文件不太了解,所以希望我缺少一些小东西。 Caused by: java.io.FileNo
我不明白为什么会发生这种情况。我对其他问题做了一些研究,发现使用 for 循环时无法修改集合。但是,我正在使用迭代器,为什么它不起作用? int counter = 0; int otherC
目前我正在使用 OSX Server (Yosemite) 来托管一堆 PHP 应用程序,其中一些应用程序在网站文档根目录下有一个子目录用于子域。自更新到 Yosemite 版本的 OSX Serve
SqlCommand objsql = new SqlCommand(); . . objsql.Parameters.AddWithValue("@Param1", DBNull.Value); .
当我尝试将“对象”添加到数据库然后将其显示到 TableView 时,它显示 UnsupportedOperationException 。一切都很好,直到我将此代码添加到“public void i
我收到以下错误日志: 05-29 20:57:29.886: D/AndroidRuntime(359): Shutting down VM 05-29 20:57:29.896: W/dalvikv
我有两个项目,第一个是Ejb3项目,名称是SessionBean,另一个是java项目,名称是SessionBeanClient。对于 IDE,我使用 eclipse indigo。我已经完成了代码,
我有一个使用表单成员身份验证的 ASP.NET Web 应用程序。我们最近进行了渗透测试,标记的一个问题是窃取用户帐户的能力。如果 .ASPXAUTH cookie 值是在注销之前从用户复制的,用户可
我是一名优秀的程序员,十分优秀!