Hey all!
Just doing some tinkering with python. I am running mac os x and I am wondering how I can call unix commands from python. In C I think I would use a fork, although it has been sometime since I have used C so I am a little fuzzy on the syntax.
I also want to use what the unix command returns.
Example:
Typed in the command line: python myProgram.py
myProgram.py needs to call the unix ls command and it needs to read in the output from the ls command.
If someone could give me a link or tell me what term I should search for that would be super. Did some searching but wasnt really sure what to search for.
Thanks all! Have a great night!
JS
Just doing some tinkering with python. I am running mac os x and I am wondering how I can call unix commands from python. In C I think I would use a fork, although it has been sometime since I have used C so I am a little fuzzy on the syntax.
I also want to use what the unix command returns.
Example:
Typed in the command line: python myProgram.py
myProgram.py needs to call the unix ls command and it needs to read in the output from the ls command.
If someone could give me a link or tell me what term I should search for that would be super. Did some searching but wasnt really sure what to search for.
Thanks all! Have a great night!
JS
Comment