我正在制作软件以进行一些电气接地计算。我已经导入了以下内容以及代码的开头:
import Pmw
from math import sqrt, pi, log
from sympy import Symbol, solve, Eq, pprint
import sys
from Tkinter import *
import tkHyperlinkManager
import webbrowser
import tkFileDialog
#sys.setrecursionlimit(1000)
class EarthCalc(Frame):
def __init__(self, master):
Frame.__init__(self, master)
self.grid()
self.create_widget()
现在,正如您所看到的,我已经尝试使用" sys.setrecursionlimit",但错误仍然存在。现在,我面临的问题是。当我使用" py2exe" 编写脚本到.exe时。我得到了:
RuntimeError: maximum recursion depth exceeded
虽然代码在" .py扩展程序" 中运行得非常好。帮我解决这个问题,以下是我如何结束代码:
root = Tk()
root.title("Earthing Calculation")
root.geometry("650x620")
root.config(menu=menubar)
menubar = Menu(root)
"""Here there's the body of the Menubar"""
C = EarthCalc(root)
root.mainloop()
帮助理解,如何解决这个问题。以下是最后的堆栈跟踪。
File "c:\Python27\lib\site-packages\py2exe\mf.py", line 423, in scan_code
self._safe_import_hook(name, m, fromlist, level=level)
File "c:\Python27\lib\site-packages\py2exe\mf.py", line 332, in
_safe_import_hook
self.import_hook(name, caller, level=level)
File "c:\Python27\lib\site-packages\py2exe\mf.py", line 719, in import_hook
return Base.import_hook(self,name,caller,fromlist,level)
File "c:\Python27\lib\site-packages\py2exe\mf.py", line 134, in import_hook
self.msg(3, "import_hook", name, caller, fromlist, level)
RuntimeError: maximum recursion depth exceeded
c:\Python27>