Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reading multiple raw_inputs
#6
(Apr-19-2017, 08:16 PM)nilamo Wrote: I thought that was only if you wanted to get the result/stdout of the command or if you didn't want to block while it ran, while os.system was fine for fire-and-forget type things?

subprocess module allows a lot of options. You may "fire and forget" - though I am not sure that's a good approach, and if you start a long process without saving reference to process object, how garbage collector will affect it.

You may capture output, redirect it to a pipe, to a file. Send input to process. Get execution results. Though I no longer see threats to discontinue os.system (I believe there were some), I tend to follow recommendations of documentation.

I am also not sure that os.system is "fire-and-forget" thing - if you don't redirect stdout, it will throw it it on your terminal
Test everything in a Python shell (iPython, Azure Notebook, etc.)
  • Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
  • Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
  • You posted a claim that something you did not test works? Be prepared to eat your hat.
Reply


Messages In This Thread
Reading multiple raw_inputs - by bindo - Apr-19-2017, 06:51 AM
RE: Reading multiple raw_inputs - by nilamo - Apr-19-2017, 07:45 PM
RE: Reading multiple raw_inputs - by volcano63 - Apr-19-2017, 07:53 PM
RE: Reading multiple raw_inputs - by nilamo - Apr-19-2017, 08:16 PM
RE: Reading multiple raw_inputs - by volcano63 - Apr-19-2017, 08:47 PM
RE: Reading multiple raw_inputs - by snippsat - Apr-19-2017, 08:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Reading Multiple text Files in pyhton Fatim 1 2,584 Jun-25-2021, 01:37 PM
Last Post: deanhystad
  Reading csv with multiple "headers" Clives 3 3,591 Dec-31-2020, 09:25 AM
Last Post: Ana_junior
  Reading Multiple Lists Using SUM function dgrunwal 6 4,568 Jun-03-2020, 08:23 PM
Last Post: dgrunwal

Forum Jump:

User Panel Messages

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