How do I include a PHP script in Python?

后端 未结 5 2223
暗喜
暗喜 2021-02-09 05:56

I have a PHP script (news-generator.php) which, when I include it, grabs a bunch of news items and prints them. Right now, I\'m using Python for my website (CGI). When I was usi

5条回答
  •  灰色年华
    2021-02-09 06:08

    PHP is a program. You can run any program with subprocess.

    The hard part is simulating the whole CGI environment that PHP expects.

提交回复
热议问题