Reputation: 13
Is there a way to connect to a website from a Python Tkinter GUI using HTTP requests? Essentially, I want the following functionality:
I only need to focus on the GUI side of this. I have no code to go along with this - I was just wondering if it's even possible.
Upvotes: 0
Views: 1044
Reputation: 54743
There are three components to what you ask. Your GUI can send information to your web server using some URL you would have to invent. It can be as simple as:
import requests
requests.get("http://example.com/information?name=Joe+Smith")
Then, your web server needs to respond to that request by saving the information somewhere. Your web server also needs a similar request to return the information. Then, your web page needs Javascript on a timer doing an AJAX request to fetch that info, and to change some field on the page in response. That depends on what Javascript tools you're using.
Upvotes: 1