展开全部
2 应该是你当前文件夹里面有一e69da5e6ba9062616964757a686964616f31333363393730个叫urllib.py的文件,是你自己创建的.
最近在对照Bucky Roberts的tutorial学习python,遇到一些问题,就顺便一起问掉好了。
1. project interpreter的module导入,没有可以添加的module,下图:
2. 从网站上下载图片(这段代码别人运行OK的,但是我会有错误代码)
import random
import urllib
def download_web_image (url):
name = random.randrange(1,1000)
full_name = str(name) + ".jpg"
urllib.urlretrieve(url,full_name)
download_web_image("ntoronto.com/wp-content/uploads/2012/07/self-image.jpg")
错误提示:
E:\Python\python.exe C:/Users/Administrator/PycharmProjects/untitled/image.py
Traceback (most recent call last):
File "C:/Users/Administrator/PycharmProjects/untitled/image.py", line 9, in
download_web_image("hoachin