Home > Backend Development > PHP Tutorial > No response when php calls python

No response when php calls python

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-08-04 09:20:51
Original
1904 people have browsed it

In the php file, I tried to use system() to call a .py file. Why didn’t it happen?

This is the php code

<code><?php
    system('python E:\WEB\Python\py\learn\php_get_python.py');
</code>
Copy after login
Copy after login

The following is the python code

<code># -*- coding: utf-8 -*-

import sys

def php_get_python():
    print u'hello world 这里php就调用了.py文件'

if __name__ == '__main__':
    php_get_python()</code>
Copy after login
Copy after login

ps: I am using phpstudy to configure the environment under windows

Reply content:

In the php file, I tried to use system() to call a .py file. Why didn’t it happen?

This is the php code

<code><?php
    system('python E:\WEB\Python\py\learn\php_get_python.py');
</code>
Copy after login
Copy after login

The following is the python code

<code># -*- coding: utf-8 -*-

import sys

def php_get_python():
    print u'hello world 这里php就调用了.py文件'

if __name__ == '__main__':
    php_get_python()</code>
Copy after login
Copy after login

ps: I am using phpstudy to configure the environment under windows

system('E:WEBPythonpylearnphp_get_python.py'); Execute directly like this

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template