Jump to content

Archived

This topic is now archived and is closed to further replies.

Darkness Soul

how to execute python files

Recommended Posts

Yo,

I need a little help over there.. I wanna to run a python script from a php page.. something like:
[code]/* block code */
switch ( $var )
{
  case 1:
      # run first.py
  case 2:
      # run second.py
}
/* block code */[/code]
This is just an exemple from my idea..

Thanks anyway.

D.Soul

Share this post


Link to post
Share on other sites
hm, its don't work.. i've tried it this logic:

print '1'
shell_exec
print '3'

the py file is togheter in the same folder, so i use the $result as you said, but, it print '1', and stop printing.. do nothing..

tonight i will try better, now im little busy, but thanks =)

D.Soul

Share this post


Link to post
Share on other sites
Try putting whatever you would put on the command line into a shell_exec because I don't know much about executing python.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.