-3
私はPython 3.4.2をLinuxで使用しています。Python urllibでlocalhostを開くことができません
myurl = 'http://localhost/test.php'
response = urllib.urlopen(myurl)
while response.text != 'exit':
response = urllib.urlopen(myurl)
と私はモジュールがurllib.request.urlopen
あるのpython 3では、このエラー
Traceback (most recent call last) :
File "/var/www/html/led.py", line 19, in <module>
response = urllib.urlopen(myurl)
AttributeError: 'module' object has no attribute 'urlopen'
below-示すようにPythonで[ 'urllib.request.urlopen'(https://docs.python.org/3/library/urllib.request.html#module-urllib.request)それを使用3 –