pythonnetwork-programmingtkinterprojector

Fetching information from network projectors using python script


I have a small network which includes multiple PCs and projectors. Normally, I am able to see the projector status(running time, lamp life, etc) via browser when i typed in the ip address of particular projector. I am wondering if it is possible to fetch the information of the projectors on the network using a python script. My idea is to create a small tkinter app which will display those projector status when the user request.I must admit that i am being too ambitious as i don't have enough knowledge on network programming. But if any of you can help me out , i will greatly appreciate.


Solution

  • It sort of depends on how complicated the page is. If it's plain text, then something like this should work

    import urllib
    stats_text = urllib.urlopen('http://ip.of.projector').read()
    

    If you need to parse the returned page at all to extract the values, you might want to look at BeautifulSoup