0

In this question I asked about creating a new terminal and start another python program int it from a python program and managed to do it. In the answer I accepted I was told, that

subprocess.Popen(["xterm", "python"])

would open a new terminal window and start the python interpreter in it.

How can I send commands to that window so that "magically" there can appear any python code to be processed py the interpreter?

monamona
  • 1,195
  • 2
  • 17
  • 43
  • When you say "send commands" do you mean you want to "type" programmatically some characters into the Python interpreter in the launched xterm? Can you explain more why you're trying to do this? It is highly unusual. – John Zwinck Nov 25 '17 at 07:19
  • Firtt Question: Exactly! You got what I mean. IN the best case somebody could tell me how to "press enter" from my other program as well. – monamona Nov 25 '17 at 07:21
  • Second Question: I'm writing a learner's program and want a "demo" button that resolves exercises by live demonstration – monamona Nov 25 '17 at 07:23
  • OK...what OS are you using? This is not possible in a cross-platform way. – John Zwinck Nov 25 '17 at 07:50
  • Raspbian, so basically all debian stuff works on there – monamona Nov 25 '17 at 07:54

0 Answers0