只需要安装urequests
你好,可以从网络下载requests包,存储到/sdcard 或者/data分区的根目录,即可 import requests
import os
import time
import network
import requests
sta=network.WLAN(0)
# Fill in your router's ssid and password here.
sta.connect("xxxxxx","xxxxxxxx")
print(sta.status())
while sta.ifconfig()[0] == '0.0.0.0':
os.exitpoint()
while True:
os.exitpoint()
res = requests.get(url='http://www.baidu.com/')
print(res.text)
time.sleep(3)
request文件夹放在了/sdcard根目录下,但运行后:wpa_state=SCANNING
p2p_device_address=00:e0:4c:64:07:e0
address=00:e0:4c:64:07:e0
uuid=26ca2bb6-1825-5304-9d66-1d1c12d093a0
Traceback (most recent call last):
File "", line 14, in
AttributeError: 'module' object has no attribute 'get'
MPY: soft reboot
from requests import requests,这样就合适了,而且百度可能访问不了,换个其他的就好了