Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/332.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在linux桌面上显示实时记分卡_Python_Xml_Linux_Elementtree - Fatal编程技术网

Python 在linux桌面上显示实时记分卡

Python 在linux桌面上显示实时记分卡,python,xml,linux,elementtree,Python,Xml,Linux,Elementtree,我已经编写了一个python脚本,它显示了所有实时比赛的分数。我希望在我的桌面上而不是在终端上显示分数。我还希望每5分钟左右更新一次记分卡。 以下是python脚本: import xml.etree.cElementTree as ET import requests tree = ET.fromstring(requests.get('http://www.cricbuzz.com/livecricketscore/home-score-matches.xml').text) for ele

我已经编写了一个python脚本,它显示了所有实时比赛的分数。我希望在我的桌面上而不是在终端上显示分数。我还希望每5分钟左右更新一次记分卡。 以下是python脚本:

import xml.etree.cElementTree as ET
import requests
tree = ET.fromstring(requests.get('http://www.cricbuzz.com/livecricketscore/home-score-matches.xml').text)
for elem in tree.iter('match'):
    state = elem.find('state').text
    footer = elem.find('footer').text
    header = elem.find('header').text
    print state,header,footer


如何实现上述功能?

您需要为此构建GUI。有很多图书馆应该会有所帮助。举几个例子-,等等。

你不需要像Vikas Neha建议的那样使用任何花哨的GUI东西。您所需要的只是pynotify库

pynotify.init("TEST")
notice=pynotify.Notification("Your Score card",string_to_show)
notice.show()
这将在屏幕上的气泡通知上显示您的消息