是否有可能让 python IDE 在 PYQT4 小部件中工作?
Is it possible to get a python IDE working inside a PYQT4 widget?
我正在做一些需要在 PYQT4 window 中使用 python IDE 的工作,我四处搜索了一下,一般的想法是这是可能的,但是没有人说如何。如果有人可以 post 一些在 window 中得到 IDE 的代码,我可以从那里改编它。
谢谢
Python 3.5,PYQT4,如果还需要回答请注明
您可以使用执行命令
通过在 editLine 中输入命令来获取命令
z = self.editFunktion.text() #put the Funktion in z
z = str(z) #converted it into str() (sometimes needed)
exec z #exec takes the String and executes it
如果您使用模块中的 Funktion,请务必正确输入它,例如:
如果您将 numpy 导入为 np,那么 editLine 中的 sinus Funktion 必须这样写:
x=np.sin(5)
希望这会有所帮助
我正在做一些需要在 PYQT4 window 中使用 python IDE 的工作,我四处搜索了一下,一般的想法是这是可能的,但是没有人说如何。如果有人可以 post 一些在 window 中得到 IDE 的代码,我可以从那里改编它。
谢谢
Python 3.5,PYQT4,如果还需要回答请注明
您可以使用执行命令
通过在 editLine 中输入命令来获取命令
z = self.editFunktion.text() #put the Funktion in z
z = str(z) #converted it into str() (sometimes needed)
exec z #exec takes the String and executes it
如果您使用模块中的 Funktion,请务必正确输入它,例如:
如果您将 numpy 导入为 np,那么 editLine 中的 sinus Funktion 必须这样写:
x=np.sin(5)
希望这会有所帮助