添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
威武的茶叶  ·  第一百九十八章 ...·  4 月前    · 
玩命的海豚  ·  Setting Up VS Code ...·  6 月前    · 
乖乖的生姜  ·  Touch & Drag 事件 - ...·  6 月前    · 
For many years I have been using a little piece of software written in Python that creates a GUI in a video game
and allows the user to create objects/characters while the game is running, for custom modding purposes.
It uses Tkinter included in the Python included with the game. The game (Blade of Darkness)dates from 1999
so quite ancient. I've used this script over various PCs starting with win98se. Big Grin
My problem is this: I recently got a new PC with win 10, which runs like lightning and the game also runs fine,
but if I try to start the add-on script it throws up a error....
Traceback (innermost last):
  File "DefFuncs.py", line 1787, in InitEB
    import EBrowser
  File "..\..\Scripts\EBrowser.py", line 2365, in ?
    root = Tkinter.Tk()
  File "..\..\Lib\PythonLib\lib-tk\Tkinter.py", line 886, in __init__
    self.tk = _tkinter.create(screenName, baseName, className)
TclError: Can't find a usable init.tcl in the following directories: 
    {} ./lib/tcl8.0 ./lib/tcl8.0 ./library ./library ./tcl8.0/library ./tcl8.0/library
This probably means that Tcl wasn't installed properly.

It is exactly the same script and installation on my old (win 7) pc, where it works. So I can only conclude the
the win 10 os does not like it somehow.
Any possible fixes greatly appreciated. I should point out that while I am reasonably conversant with python
my knowledge is largely confined to programming this game. Cry
Quote: root = Tkinter.Tk()
It seems you're trying to run a 2.7 script in 3.x
you can modify the import to tkinter and the :
root= tkinter.Tk()
there may be other parts also... not enough info or download and run python 2.7 Thanks for the reply. If I modify the import all that happens is I get a name error.
I have been out of contact with the guy who wrote the script for many years so I can't get
a fix from him. Just to say, I cured it by copying the entire TCL folder from the PythonLib of the game and pasted it
directly on the main drive. Set -
setx /M TCL_LIBRARY "C:\Tcl\lib\tcl8.0"
via the Admin command prompt and it works as normal.