python调用系统命令出现的多余数据
高洛峰
高洛峰 2017-04-18 09:23:20
0
3
583
高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(3)
左手右手慢动作
subprocess.check_output(["curl -s cip.cc"],shell=True)

man curl

   -s, --silent
          Silent or quiet mode. Don't show progress meter or error messages.  Makes Curl mute. It will still output the data you ask for, potentially even to the terminal/stdout unless you redirect it.
PHPzhong

Try the following code:

subprocess.check_output(["curl -s cip.cc"],shell=True)

I don’t know what platform you are using curl -h Take a look at the parameter settings

刘奇

For example, are there any difficulties in using the standard library? Do you need system calls? When calling curl through subprocess, you have to manually handle various exceptions such as timeout, stderr, stdout, and process return code...urllib

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template