在python中显示带有“圆形加载图标”的对话框

时间:2012-01-31 04:19:05

标签: python python-3.x pygtk

我的问题很简单,我想展示一个像这样的动画圈子的对话框 enter image description here

有没有可移植的方法来执行此操作而不使用.gif图像?
注意:图像是一个例子,我想使用pygtk中包含的那个

3 个答案:

答案 0 :(得分:2)

如果GTK确实是你的意思,请使用Gtk.Spinner

答案 1 :(得分:0)

您可以尝试使用画布http://thinkvitamin.com/code/how-to-draw-with-html-5-canvas/ 但是我认为.gif是更加无痛的方式。

答案 2 :(得分:0)

import os,time
blah = True #4 forever
l = ["|","/","-","\\"]
I = 0
while True:
    try:
        i = l[I]
    except IndexError:
        I = 0
        i = l[I]
    if not blah: #when to stop
        break
    print i
    time.sleep(.1) #delay before changing
    os.system('CLS') #clear screen
    I+=1

控制台加载图标

相关问题