On my Ubuntu 20.04 machine, when I run: mkdir -p /home/parent/{child1,child2} These folders get created in /home . parent parent/child1 parent/child2 However, when I try to run this in a python script using bashCommand = "mkdir -p /home/parent/{child1,child2}" # print(bashCommand) subprocess.run(bashCommand.split(), capture_output=True) I end up having these folders in my /home directory instead. parent parent/{child1,child2} How can I fix this?
Originally asked by CST on Stack Exchange (askubuntu) (CC BY-SA 4.0).