PHP run python code
Posted: Tue Jun 16, 2015 5:24 am
hi there.. im having this python scripts snippet:
import webbrowser
url = 'http://idiotinside.com'
# Open URL in new browser window
webbrowser.open_new(url) # opens in default browser
# Opens in mozila browser
webbrowser.get('firefox').open_new_tab(url)
and PHP code to execute the python:
exec('C:\Python27\python.exe C:\xampp\htdocs\wd\launch_ff.py');
but it seems firefox is not launched.
Need help!!
import webbrowser
url = 'http://idiotinside.com'
# Open URL in new browser window
webbrowser.open_new(url) # opens in default browser
# Opens in mozila browser
webbrowser.get('firefox').open_new_tab(url)
and PHP code to execute the python:
exec('C:\Python27\python.exe C:\xampp\htdocs\wd\launch_ff.py');
but it seems firefox is not launched.
Need help!!