当前位置: 动力学知识库 > 问答 > 编程问答 >

Error with Tkinter in Python (v2.7.6) using Cloud9 (c9.io)

问题描述:

I am currently using Python 2.7.6 in Cloud9 to develop a text editor. In order to do that, I am using the Tkinter library, but no matter what code I use, as long as it calls any Tkinter function, I get the following error:

self.tk = _tkinter.create(screenName, baseName, className,

interactive, wantobjects, useTk, sync, use)

_tkinter.TclError: couldn't connect to display "Text Editor"

This is a sample of a very basic python file I use to test the possible solutions I have come to find, even though none worked:

from Tkinter import *

root=Tk("Text Editor")

root.mainloop()

Sorry for not including any more details, but it is the first time I use Tk, and so I have little knowledge about this problem. Thanks in advance!

分享给朋友:
您可能感兴趣的文章:
随机阅读: