Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cmd terminal
#7
(Apr-22-2024, 04:30 AM)Rice23 Wrote: If one wishes to display the output from the command, how can it be obtained from the Popen call and displayed in a tkinter window?
You can write
process =  subprocess.run(['command', 'arg', 'arg'], capture_output=True, encoding='utf8')
print(process.stdout)
print(process.stderr)
Then instead of printing the strings process.stdout and process.stderr, you can insert them in a Tkinter Text widget for example.
« We can solve any problem by introducing an extra level of indirection »
Reply


Messages In This Thread
cmd terminal - by Raysz - Apr-11-2024, 07:28 PM
RE: cmd terminal - by deanhystad - Apr-11-2024, 08:42 PM
RE: cmd terminal - by Raysz - Apr-12-2024, 04:43 AM
RE: cmd terminal - by deanhystad - Apr-12-2024, 11:56 AM
RE: cmd terminal - by Raysz - Apr-12-2024, 04:11 PM
RE: cmd terminal - by Rice23 - Apr-22-2024, 04:30 AM
RE: cmd terminal - by Gribouillis - Apr-22-2024, 06:54 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020