You may find this useful if your 4G dongle disconnects from the internet periodically
pip install requests
Copy the reconnectE3372.py
file to the folder with your project
import reconnectE3372
etools = reconnectE3372.IPTools()
# Change IP
etools.changeip()
# Print the new IP
print(etools.ip)