0

I would like to know how can I open two python functions on the same script and display them in different terminals

def fn1():
    print ("1 function")

def fn2():
    print("2 function")

I know with subprocess one can open two scripts in different terminal eg:

subprocess.call (['lxterminal', '-e',"python3", "/home/pi/m/code/sensor1.py"])

subprocess.call (['lxterminal', '-e',"python3", "/home/pi/m/code/sensor2.py"])

HOW CAN I DO THE ABOVE WITH FUNCTION IN THE SAME SCRIP.

Thank YOU :)

Bimal
  • 1,175
  • 8
  • 16
  • This was already answered here: https://stackoverflow.com/questions/30266166/how-do-you-run-multiple-files-in-multiple-terminal-windows-using-python call(["lxterminal", "-e", "python3", "/path/to/file.py"]) – Jakob Schödl Apr 03 '20 at 12:56
  • Does this answer your question? [How do you run multiple files in multiple terminal windows using python](https://stackoverflow.com/questions/30266166/how-do-you-run-multiple-files-in-multiple-terminal-windows-using-python) – Sheri Apr 03 '20 at 19:30

0 Answers0