使用python下载xml并在命令行不打印任何内容

2024-06-17 14:57:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我目前在python脚本中使用此选项:

os.system("sudo wget -P /etc/lirc/http://localhost:80/example.xml")`

当我运行脚本时,它会在命令行中打印此内容:

--2015-04-17 13:26:27--  http://localhost:80/example.xml
Connecting to http://localhost:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/xml]
Saving to: /etc/lirc/example'

[ <=>                                   ] 612         --.-K/s   in 0s

我还能用什么来避免打印


Tags: to命令行脚本localhosthttp内容osexample