#๐ os.system
16 messages ยท Page 1 of 1 (latest)
@lone spindle
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
hello?
reading stdin/out or subprocess being written to return stuff i think
what
if there was a "best", why would the others exist?
os.system just runs a command in a subshell and gives you the return status code
with subprocess, you can actually spawn subprocesses and communicate with them. usually subprocess.run is enough
os.system just runs a command in a subshell and gives you the return status code
no does not
try running ```py
print(os.system("cd"))
how was that supposed to disprove what i said? it printed 0, because it succesfully ran, so there was a 0 status code
it printed the location
no it did not. thats probally what cd with no arguments does on windows, but the print itself should print 0. it cant return a string - it returns an int.
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.