How to create an application which takes an input from the command line or terminal?

edited May 2016 in Python Mode

Hello,

Not super new to Processing but have not use it in great lengths/depths. Anyways, I wanted to know if it was possible to create an application which takes an input from the command line or terminal.

Here is my goal:

1- A python code, which I have already created, executes the compiled/exported processing application using the terminal

os.system('sudo home/pi/..../countdown')

2- The processing application consists of a countdown clock for which I would like to have the starting time be an input variable so that;

os.system('sudo home/pi/..../countdown 20')

Executes the countdown application at 20 minutes.

Any thoughts or ideas?

Answers

  • You could use pure java for it, but I don't think it is possible using Processing IDE.
    For help - Processing in Eclipse

  • Thank you Lord_of_the_Galaxy! After doing a little more research I opted for having my pyhton function write the information needed on a text file that then my processing code runs. I am using Processing because I thought it would be the easiest way of building a UI!

  • Yes, Processing is by far one of the easiest way to build a custom interactive GUI.
    Using a text file is a good enough idea, and it can be expanded on to many more projects. But if you want to distribute it to other computers take care that the path to text file is not specific, but varies with the computer. Good job and best of luck for your project.

  • You are very right, in fact "cross-platform path/directory compliance" (per se) was my task today! My program wont run outside of Raspberry Pis, so I am not to worried tho. Thanks for following up!

  • Raspberry Pi? That's nice.
    After a bit of thought, I realised that text files can be used to create a sort of communication system b/w different programs.

Sign In or Register to comment.