当前位置:首页 > 日记本 > 正文内容

python中运行php文件

zhangchap2年前 (2022-11-13)日记本199
import subprocess

def run_php():
    proc = subprocess.Popen("php /www/wwwroot/tag.php", shell=True, stdout=subprocess.PIPE)
    script_response = proc.stdout.read()
    print(script_response.decode().strip())


分享给朋友:

相关文章

配置存储(IIS 7)

适用于:Windows 7,Windows Server 2008,Windows Server 2008 R2,Windows Vista IIS 7使用一种新的...

lxml win 安装方法

文档地址:https://lxml.de/installation.htmlwindows 下安装不了的都可以在这里找:https://www.lfd.uci.edu/~gohl...

python 函数 开启多线程示例

from threading import Thread def readfile(queue:Queue):    &nbs...

python xpath语法总结

python xpath语法总结:常用的://1.从任意节点开始/2.从根节点开始//div/p3.div下的p标签//div[@class="hrzz_bottom"]/ul/l...

python fake_useragent 模块用法

我们每次发送requests请求时通过random从中随机获取一个随机UserAgent,两行代码即可完成UserAgent的不停更换 from fake_useragent i...

减重五原则

1.主粮减半,少吃米面粥粉等;2.完全戒糖,包括可乐、奶茶等3.轻断食,每周一次,一日餐4.不限制任何动物脂肪和肉类,少吃植物油;5.保证随时喝到水,脂肪的消耗需要大量的水。...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。