Page 1 of 1

urllib.urlopen

PostPosted: Mon May 16, 2022 1:46 pm
by zoff
I upgraded to Indigo 2022.1 and I had to revert back to Indigo 2021.2 because I was getting many errors.
I use many scripts with urllib.urlopen to controll Shelly modules.
Code: Select all
urllib.urlopen("http://THE IP OF THEMODULE/relay/0/?turn=on")

What do I need to change for my scripts to work under python3 and Indigo 2022.1?

Thanks.

Re: urllib.urlopen

PostPosted: Mon May 16, 2022 2:06 pm
by jay (support)
Use the requests lib instead:

Code: Select all
import requests
requests.get("http://THE IP OF THEMODULE/relay/0/?turn=on")


Or use one of the Shelly plugins.