문제

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.

도움이 되었습니까?

해결책

You can say:

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

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

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top