0

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.

asked Mar 31, 2014 at 12:21
3
  • 2
    "But I don't know how to write commands to the terminal from my own code." Try subprocess. Commented Mar 31, 2014 at 12:23
  • @Kevin I think by terminal he means the SSH client that he uses to connect to his RPi, in this case it's probably best to use this. Commented Mar 31, 2014 at 12:25
  • @Kevin Thanks, I'll look into it. André It's not that complicated yet. But the project might become that advanced. Commented Mar 31, 2014 at 12:32

2 Answers 2

2

You can say:

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

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

answered Mar 31, 2014 at 12:50
Sign up to request clarification or add additional context in comments.

Comments

0

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.

answered Mar 31, 2014 at 12:33

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.