这个脚本有很多错误吗?

2024-09-21 01:11:26 发布

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

我已经在这里呆了45分钟了。我急需帮助。在

当我运行这个:

import urllib, urllib2

proxy = urllib2.ProxyHandler({
    'http': '127.0.0.1',
    'https': '127.0.0.1'
})
opener = urllib2.build_opener(proxy)
urllib2.install_opener(opener)
# this way both http and https requests go through the proxy
urllib2.urlopen('http://www.google.com')
urllib2.urlopen('https://www.google.com')

我明白了:

^{pr2}$

更新:

修复了随机.py发布并获得:

^{3}$

Tags: installhttpsimportbuildcomhttpwwwgoogle
1条回答
网友
1楼 · 发布于 2024-09-21 01:11:26

当前目录中有一个名为random.py的文件。将其重命名为random_.py。在

注意,使用C:\Python27中的文件进行开发可能不是一个好的实践。在

相关问题 更多 >

    热门问题