Python 2.7 有了ActiveTcl8.5.14和Python 2.7,哪些是好的在线资源?

Python 2.7 有了ActiveTcl8.5.14和Python 2.7,哪些是好的在线资源?,python-2.7,tkinter,Python 2.7,Tkinter,我正在尝试使用Tkinter和Python2.7编写我的第一个程序。我安装的Tkinter库是:ActiveTcl8.5.14。我的问题是:对于这种组合,什么是好的在线资源?我一直在尝试和错误中取得进步,但现在我被卡住了。我正在尝试将stringVar设置为文件名。但是我担心我使用的代码是错误的Python或Tkinter版本 def abrir_capitulo(): ##Dialog box for selecting the chapter to be loaded. im

我正在尝试使用Tkinter和Python2.7编写我的第一个程序。我安装的Tkinter库是:ActiveTcl8.5.14。我的问题是:对于这种组合,什么是好的在线资源?我一直在尝试和错误中取得进步,但现在我被卡住了。我正在尝试将stringVar设置为文件名。但是我担心我使用的代码是错误的Python或Tkinter版本

def abrir_capitulo():
    ##Dialog box for selecting the chapter to be loaded.
    import tkFileDialog
    WORDLIST_FILENAME = tkFileDialog.askopenfilename(mode='r',parent=master,title="Archivo para abrir")
这是回溯:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 1470, in __call__
    return self.func(*args)
  File "/Users/Noel/Documents/Professional Development/MIT CS 6.0/Recall Game/Recall_Game.py", line 103, in abrir_capitulo
    WORDLIST_FILENAME = tkFileDialog.askopenfilename(mode='r',parent=master,title="Archivo para abrir")
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/tkFileDialog.py", line 125, in askopenfilename
    return Open(**options).show()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/tkCommonDialog.py", line 48, in show
    s = w.tk.call(self.command, *w._options(self.options))
TclError: bad option "-mode": must be -defaultextension, -filetypes, -initialdir, -initialfile, -message, -multiple, -parent, -title, -typevariable, or -command
根据,askopenfilename没有模式参数

WORDLIST_FILENAME = tkFileDialog.askopenfilename(parent=master,title="Archivo para abrir")

有关文档,请参阅。

就是这样!非常感谢!