Question

I am new to programming, so I bearly have any unix experience at all. And I don't even know if that would have helped me right now.

I want to write a program that when given a input, lets say "enter". It should call for a software already installed on the Pi. Software that allows it to take pictures.

I know how to take pictures from the terminal. But I don't know how to write commands to the terminal from my own code.

Do anyone know where I can find usefull information about writing these kinds of software? I have looked but I might have missed some keywords in my googling.

Was it helpful?

Solution

You can say:

import os
os.system("your command line expression")

To run a terminal command from inside of a python program.

OTHER TIPS

This page has documentation that will help you:

https://docs.python.org/2/library/subprocess.html

You can use subprocess to start other programs from your python script.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top