Requests via uPy "requests" library
Installed request library into Python310 via :
C:\Users\Dell\AppData\Local\Programs\Python\Python310\Scripts where pip lives.
Then did a pip install requests to get the library put into scripts folder. Can see it's there with
pip install list -v .
Wrote this simple request program based on W3 Schools' one:
--------------------------------------
import requests
#the required first parameter of the 'get' method is the 'url':
x = requests.get('https://w3schools.com/python/demopage.htm')
#x=requests.get('https://google.com')
#print the response text (the content of the requested file):
print(x.text)
-----------------------------------------------------and got back --------
= RESTART: C:\Users\Dell\AppData\Local\Programs\Python\Python310\myfiles\request0.py
<!DOCTYPE html>
<html>
<body>
<h1>This is a Test Page</h1>
</body>
</html>
--------------------------------------Had to use 'normal internet' for this.
Next try similar using py pico on 192.168.4.1

Comments
Post a Comment