1

I'm doing some work that require a python IDE inside a PYQT4 window, I've searched around and the general idea for this is that it is possible but non of them say how. If someone can post some code that gets an IDE inside of the window i can adapt it from there.

thanks

Python 3.5, PYQT4, if any more are needed to answer this please state

Ariten
  • 13
  • 2
  • What do you mean by "Python IDE"? – ekhumoro Nov 05 '15 at 17:43
  • A integrated programming area, an area that a student can program into and it wont affect the running of the main program and it will be able to return the value at the end to the main program. I need to have an area where the student can program into in python and have it be able to be read. – Ariten Nov 06 '15 at 10:18
  • So, not an IDE, then - you just want to [embed a python console](http://stackoverflow.com/q/11513132/984421). – ekhumoro Nov 06 '15 at 16:22

1 Answers1

0

You could use the exec-command

get the Command by typing it into an 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

If you use a Funktion from an module be shure to type it correct e.g.:

If you imported numpy as np then the sinus Funktion in the editLine has to be written like:

x=np.sin(5)

Hope this will help

Spiegie
  • 42
  • 6