1

I have two files in the same directory:

index.php
excel.py

I tried to call excel.py in file index.php like:

$buff = system('python excel.py ' . $handle->file_dst_pathname, $retval);

I use Windows 10

7
  • What happened when you tried? Was there an error message? What webserver are you using? Commented Nov 16, 2017 at 23:03
  • No any errors, I think I have to specify full path to file (d:\path) then after gap: d:\path python excel.py Commented Nov 16, 2017 at 23:04
  • I try that under windows Commented Nov 16, 2017 at 23:07
  • Python file in windows must be in python directory C:\python27\> python file.py Commented Nov 16, 2017 at 23:07
  • 1
    exec("C:\Python27\python.exe C:\dir...\file.py") have you tried it like this? Commented Nov 16, 2017 at 23:11

1 Answer 1

2

Try it like this,

exec("C:\Python27\python.exe C:\dir...\file.py");

The problem is you must call C:\Python27\python.exe Python exe file before python file.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.