0

I have a script that I want to run from os.system but it's working fine in Linux but it's not working in Windows as it is not recognizing 'xterm'.

I want to display the output in both terminal and in GUI. If I remove 'xterm' it will work on both Linux and Windows but output will display in terminal not in GUI. Is there any alternative of 'xterm' for windows?? I want to execute this command in Windows.

from tkinter import *
import os
root = Tk()
root.title("WIndows")
termf = Frame(root, height=1000, width=1000)
termf.pack(fill=BOTH, expand=YES)
wid = termf.winfo_id()
os.system('xterm -into %d -geometry 1000x1000 -e python3 test.py &' % wid )
root.mainloop()

Above Code is working fine in Linux but not in windows because of 'xterm'

  • 2
    xterm is a Linux/Unix application and not available on Windows. – Ken Kinder Jan 13 '23 at 13:52
  • Does https://stackoverflow.com/q/665566/10622916 or https://stackoverflow.com/q/48977473/10622916 help? – Bodo Jan 13 '23 at 14:06
  • Your script creates a Tk Frame, embeds an xterm in it in order to have a shell, then runs a second python script so that its output will be shown in the Frame. simpler is https://stackoverflow.com/a/56576998/1216776 – stark Jan 14 '23 at 13:31

0 Answers0