我正在使用下面的 python 代码来重置http_proxyLinux CentOS 6 中的环境变量,但它并没有为 Python 脚本的其余部分取消设置变量。
代码:
import os
print "Unsetting http..."
os.system("unset http_proxy")
os.system("echo $http_proxy")
print "http is reset"
Run Code Online (Sandbox Code Playgroud)
输出:
Unsetting http...
http://web-proxy.xxxx.xxxxxxx.net:8080
http is reset
Process finished with exit code 0
Run Code Online (Sandbox Code Playgroud)