我正在尝试从我的 python (2.75) 脚本中调用 wget:
cmd = ['wget', 'https://192.168.0.1/003/', '--tries=5', '--http-user=foo', '--http-passwd=bar', '--auth-no-challenge', '--no-check-certificate', '--output-document=temp/page.html']
proc = subprocess.Popen(cmd)
# same with subprocess.call(cmd)
它在 IDE (eclipse) 和终端中也可以正常工作,但是当我尝试从 Gnome Schedule User Guide V2.2 运行它时,我得到以下信息:
--2013-08-16 11:27:35-- https://192.168.0.1/003/
Connecting to 192.168.0.1:443... connected.
ERROR: cannot verify 192.168.0.1's certificate, issued by `blabla': Self-signed certificate encountered.
ERROR: no certificate subject alternative name matches requested host name `192.168.0.1'.
To connect to 192.168.0.1 insecurely, use `--no-check-certificate'.
--2013-08-16 11:27:37-- http://--tries=5/
Resolving --tries=5 (--tries=5)... failed: Name or service not known.
wget: unable to resolve host address `--tries=5'
--2013-08-16 11:27:37-- http://--http-user=foo/
Resolving --http-user=foo (--http-user=foo)... failed: Name or service not known.
wget: unable to resolve host address `--http-user=foo'
--2013-08-16 11:27:37-- http://--http-passwd=bar/
Resolving --http-passwd=bar (--http-passwd=bar)... failed: Name or service not known.
wget: unable to resolve host address `--http-passwd=bar'
--2013-08-16 11:27:37-- http://--auth-no-challenge/
Resolving --auth-no-challenge (--auth-no-challenge)... failed: Name or service not known.
wget: unable to resolve host address `--auth-no-challenge'
--2013-08-16 11:27:37-- http://--no-check-certificate/
Resolving --no-check-certificate (--no-check-certificate)... failed: Name or service not known.
wget: unable to resolve host address `--no-check-certificate'
--2013-08-16 11:27:37-- http://--output-document=temp/page.html
Resolving --output-document=temp (--output-document=temp)... failed: Name or service not known.
wget: unable to resolve host address `--output-document=temp'
...所以不是采用命令“wget arg1 arg2 arg3 ...”,而是尝试运行:“wget arg1”“wget arg2”“wget arg3”...
从调度程序运行时可能产生不同结果的任何线索?
我在调度程序中使用的命令是:“python /home/python/Download/Download.py”
谢谢