Darkness Soul Posted July 10, 2006 Share Posted July 10, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/14220-how-to-execute-python-files/ Share on other sites More sharing options...
ShogunWarrior Posted July 10, 2006 Share Posted July 10, 2006 Maybe something like:[code]$result = shell_exec('script1.py');[/code] Quote Link to comment https://forums.phpfreaks.com/topic/14220-how-to-execute-python-files/#findComment-55808 Share on other sites More sharing options...
Darkness Soul Posted July 11, 2006 Author Share Posted July 11, 2006 hm, its don't work.. i've tried it this logic:print '1'shell_execprint '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 Quote Link to comment https://forums.phpfreaks.com/topic/14220-how-to-execute-python-files/#findComment-56373 Share on other sites More sharing options...
ShogunWarrior Posted July 12, 2006 Share Posted July 12, 2006 Try putting whatever you would put on the command line into a shell_exec because I don't know much about executing python. Quote Link to comment https://forums.phpfreaks.com/topic/14220-how-to-execute-python-files/#findComment-56542 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.