What Shell Does Os. System Use in Python?

In Python, when I run a command with

os.system

what shell gets used?

1

1 Answer

By default it will run in the Bourne shell (that would be /bin/sh).

os.system("/bin/bash \"echo 'Rincewind rules' \" ") to use bash and have it echo "Rincewind rules".

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest