Welcome Hector,
using os.system is fine if the the commands are short and independent.
I would recommend creating a database table of tasks to be executed
db.define_table('task_queue',Field('status'),Field('command'))
The web app would queue commands (status=queued) and a web2py shell
script would monitor the task queue, pop a command (status=running),
execute it, and change the status (=completed or =error).
Have a plugin PBS that does this and interfaces with the PBS qsub/
qstat/qdel but it may be more complex than you need.
Massimo
On Jul 21, 12:11 pm, Hector Oron <[email protected]> wrote:
> Hello,
>
> I am new to the group: Hi all!
>
> I am evaluating web2py to use it on a project, and I like it very much
> so far, but I am not (yet) a python guru.
>
> Let me explain a little bit what I want to do, I have several embedded
> machines, which I would like to program issuing shell commands which
> call applications on the localhost. In the same host I was planning to
> deploy web2py as a front-end, so I can trigger the commands (not yet
> defined - maybe wget some files and flash to device). I am planning to
> attach all the front-end to a remote or local database, so I can keep
> track of software versions and some more data.
>
> I would like to ask you for advice if web2py is suitable for such
> project and how could I tackle the part of running shell commands when
> clicking on the interface buttons? (Should I just fill code with
> os.system() all over the place or is there some plugin I should use
> instead - which is recommended?)
>
> Kind regards and TIA,
> --
> Héctor Orón
>
> "Our Sun unleashes tremendous flares expelling hot gas into the Solar
> System, which one day will disconnect us."