python-exec

    0热度

    1回答

    似乎有些人正在努力构建使用Matplotlib库的Python可执行文件。 我使用CX_Freeze并能创造我的GUI不图一个可执行文件,但添加了matplolib库中的图形时,当我尝试运行可执行文件,我得到错误: from .import _methods ImportError: cannot import name '_methods' 有任何人设法得到这个工作?

    1热度

    1回答

    代码我写 tile1=0; player1=1; turn=player1 def s(): global tile1,turn,player1 print("Before",tile1) string='tile' + '1' # I am getting 1 by some function that's why I need to create variab

    1热度

    1回答

    我有一个项目试图动态创建一个新模块,然后在随后的exec语句中尝试导入该模块。 import imp s=""" class MyClass(object): def __init__(self): pass def foo(self): pass """ mod = imp.new_module("testmodule.testA") e

    3热度

    2回答

    在python3,当我运行 >>> exec("","","") TypeError: exec() arg 2 must be a dict, not str >>> exec("print('Hello')", print("World"), print("!")) World ! Hello >>> type(print("World")) World <class 'Non

    0热度

    1回答

    我对Python很新颖。我试图修改一个脚本,使其在无限循环中运行,从控制台获取Python代码行并执行Python代码行。 我谈论的东西,可以做下面的例子: Shell> myconsole.py > PredefindFunction ("Hello") This is the result of the PredefinedFunction: Hello!!! > a=1 > if a

    0热度

    1回答

    我有一个Python供电的DSL,我通过exec()执行。此DSL包含通过CFFI的本地函数调用。 调用一个只有2 C调用深度的本机函数时,堆栈溢出(所以你使它不可执行!)崩溃,在每个C函数中只有少数uint16_t被分配到栈中。 Python应用程序是一个tkinter GUI,它通过定时器(master.after(1000, self.tick))事件调用DSL,这可能会占用堆栈本身的很大一