Ceviz Forum

Geri Dön   Ceviz Forum > Programlama > Python / Zope

Cevapla
 
LinkBack Seçenekler
Eski 20/07/2008, 15:46   #1 (permalink)
Yönetim Kurulu
 
Muallim-i Âli Adlı Üyenin Profil Grafiği
 
Üyelik Tarihi: 01/2008
Yer: İstanbul
Mesaj: 254
Varsayılan Python Tkinter ProgressBar



Kod:
# Tkinter progress bar experiment
# using label and string of spaces

import Tkinter as tk

root = tk.Tk()
# width 300 and height 100, no offsets
root.geometry("300x100+0+0")
space = " "
s = ""
label = tk.Label(root, text=s, bg='blue')
label.pack(anchor='nw')

for k in range(80):
    s += space
    # increments every 100 milliseconds
    label.after(100,label.config(text=s))
    label.update() # needed

root.mainloop()
Tkinter_ProgressBar.py
http://www.4shared.com/file/55890527...ogressBar.html

Kaynak:http://www.daniweb.com/forums/thread111920.html
__________________
Güzel gören güzel düşünür, güzel düşünen hayatından lezzet alır.
(Said Nursi)


Java Tutorial:http://java.sun.com/docs/books/tutor.../download.html
Muallim-i Âli hatta değil   Alıntı Yaparak Yanıtla
Eski 20/07/2008, 15:54   #2 (permalink)
iNN
Üye
 
Üyelik Tarihi: 05/2007
Yer: Sakarya
Mesaj: 116
Varsayılan

hocam teşekkürler buda gui kullanmadan progressbar örneği:

Kod:
class progressbarClass: 
    def __init__(self, finalcount, progresschar=None):
        import sys
        self.finalcount=finalcount
        self.blockcount=0
        #
        # See if caller passed me a character to use on the
        # progress bar (like "*").  If not use the block
        # character that makes it look like a real progress
        # bar.
        #
        if not progresschar: self.block=chr(178)
        else:                self.block=progresschar
        #
        # Get pointer to sys.stdout so I can use the write/flush
        # methods to display the progress bar.
        #
        self.f=sys.stdout
        #
        # If the final count is zero, don't start the progress gauge
        #
        if not self.finalcount : return
        self.f.write('\n------------------ % Progress -------------------1\n')
        self.f.write('    1    2    3    4    5    6    7    8    9    0\n')
        self.f.write('----0----0----0----0----0----0----0----0----0----0\n')
        return

    def progress(self, count):
        #
        # Make sure I don't try to go off the end (e.g. >100%)
        #
        count=min(count, self.finalcount)
        #
        # If finalcount is zero, I'm done
        #
        if self.finalcount:
            percentcomplete=int(round(100*count/self.finalcount))
            if percentcomplete < 1: percentcomplete=1
        else:
            percentcomplete=100
            
        #print "percentcomplete=",percentcomplete
        blockcount=int(percentcomplete/2)
        #print "blockcount=",blockcount
        if blockcount > self.blockcount:
            for i in range(self.blockcount,blockcount):
                self.f.write(self.block)
                self.f.flush()
                
        if percentcomplete == 100: self.f.write("\n")
        self.blockcount=blockcount
        return
    
if __name__ == "__main__":
    from time import sleep
    pb=progressbarClass(8,"*")
    count=0
    while count<9:
        count+=1
        pb.progress(count)
        sleep(0.2)

    pb=progressbarClass(100)
    pb.progress(20)
    sleep(0.2)
    pb.progress(47)
    sleep(0.2)
    pb.progress(90)
    sleep(0.2)
    pb.progress(100)
    print "testing 1:"
    pb=progressbarClass(1)
    pb.progress(1)
kaynağı hatırlamıyorum
iNN hatta değil   Alıntı Yaparak Yanıtla
Cevapla

Bookmarks

Seçenekler

Mesaj Yazma Hakları
Yeni mesajgöndermezsiniz
Cevap yazamazsınız
Dosya ekleyemezsiniz
Mesajınızı düzenleyemezsiniz

BB code is Açık
[IMG] kodu Açık
HTML kodu Kapalı
Trackbacks are Açık
Pingbacks are Açık
Refbacks are Açık

Benzer Konular
Konu Konuyu açana göre Forum Cevap En Son Mesaj
Python Tkinter Modulu? dr0gb4 Python / Zope 11 06/08/2008 16:08
ProgressBar - İlerleme Çubuğu Muallim-i Âli Python / Zope 0 04/07/2008 07:49
ftp download progressbar young_ottoman Pascal / Delphi / Delphi.NET 8 21/06/2007 15:51
Tkinter gibi dusunmek (Thinking in Tkinter) acemi Python / Zope 0 06/05/2005 19:14
progressbar yastasinane Python / Zope 3 13/04/2005 20:51


Forum saati Türkiye saatine göredir. GMT +3. Şu anda saat 03:16.

Reklamlar & Desteklenenler
Hassas Valf | Hassas Kaplama | Antalyamız | Gazete | Ticari Bilişim | Hakan Müştak | Rüya Tabirleri | Kadın | Hastalıklar | Cepte msn ve e-posta | Webmaster | Antalya Aupair | Turkish Property Antalya | Forum | Chat | Perde | Adsl | Araba | bolindir.com | guncelle.com | livescore | Web Tasarım | evden eve nakliyat | forum | evden eve | sohbet | Resimcim| Kalifiye İnsan Kaynakları | Web Tasarım | Oyun | Yusuf KOÇ | Akın Yorulmaz | şiir | UFO | Web Tasarım | Oyunlar | Canlı Tv |


Forum Yazılımı: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright ©2001 - 2008, Ceviz.net