r/learnpython • u/westnile609 • Jun 05 '21
Running Terminal Commands With Python
I was wondering if there is a way to run terminal commands(ios) with python. Looking to change file names and other tasks that can be done in terminal ie "mv ~/Desktop/MyFile.rtf ~/Desktop/MyFile-old.rtf". Let me know!
1
Upvotes
View all comments
2
u/lowerthansound Jun 05 '21 edited Jun 06 '21
subprocess
Edit: Everyone is recommending the os module to move files, I recommend pathlib (it is neater).