Python ttk.Progressbar() Examples

The following are 14 code examples for showing how to use ttk.Progressbar(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.

You may check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module ttk , or try the search function .

Example 1
Project: Scoary   Author: AdmiralenOla   File: GUI.py    License: GNU General Public License v3.0 7 votes vote down vote up
def initialize_statusframe(self):
        """
        Initialize the frame and statusbar occupying the bottom
        """
        frame = self.bottompart
        
        frame.pb = ttk.Progressbar(frame,
                                   orient='horizontal',
                                   mode='determinate',
                                   maximum=100)
        frame.pb.pack(fill='both',expand=True,side='top')

        frame.lab = Tkinter.Label(frame,text=u"Awaiting input options")
        frame.lab.pack(in_=frame.pb,expand=True)
        #sys.stdout = StdoutToLabel(frame.lab, progressbar=frame.pb)
        sys.stdout = StdoutToLabel(frame.lab,
                                   progressbar=frame.pb,
                                   width=frame.cget('width')) 
Example 2
def __init__(self, master):
        ttk.Frame.__init__(self, master)
        self.pack()

        ttk.Label(self, text="This is an 'indeterminate' progress bar").pack(padx=20, pady=10)

        progress1 = ttk.Progressbar(self, orient='horizontal', length=500, mode='indeterminate')
        progress1.pack(padx=20, pady=10)

        ttk.Label(self, text="This is a 'determinate' progress bar").pack(padx=20, pady=10)

        progress2 = ttk.Progressbar(self, orient='horizontal', length=500, mode='determinate')
        progress2.pack(padx=20, pady=10)

        progress1.start()
        progress2.start() 
Example 3
Project: seu-jwc-catcher   Author: LeonidasCl   File: main.py    License: MIT License 5 votes vote down vote up
def login_start(self):
    global progress_var
    global progress_bar
    global progressLabel
    progress_var = DoubleVar()
    labelfont = ('times', 40, 'bold')
    progressLabel = Label(root, text="正在登录选课系统...", pady=110)
    progressLabel.config(font=labelfont)
    progressLabel.pack()
    progress_bar = ttk.Progressbar(root, variable=progress_var, maximum=100)
    progress_bar.pack(fill=BOTH, padx=20, pady=100)
    pass 
Example 4
Project: PcapXray   Author: Srinivas11789   File: userInterface.py    License: GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, base):
        # Base Frame Configuration
        self.base = base
        base.title("PcapXray")
        Label(base, text="PcapXray Tool - A LAN Network Analyzer")

        # Style Configuration
        style = ttk.Style()
        style.configure("BW.TLabel", foreground="black")
        style.configure("BW.TEntry", foreground="black")

        # 1st Frame - Initial Frame
        InitFrame = ttk.Frame(base,  width=50, padding="10 10 10 10",relief= GROOVE)
        InitFrame.grid(column=10, row=10, sticky=(N, W, E, S))
        InitFrame.columnconfigure(10, weight=1)
        InitFrame.rowconfigure(10, weight=1)

        # Pcap File Entry
        self.pcap_file = StringVar()
        self.filename = ""
        ttk.Label(InitFrame, text="Enter pcap file path: ",style="BW.TLabel").grid(column=0, row=0, sticky="W")
        self.filename_field = ttk.Entry(InitFrame, width=30, textvariable=self.pcap_file, style="BW.TEntry").grid(column=1, row=0, sticky="W, E")
        self.progressbar = ttk.Progressbar(InitFrame, orient="horizontal", length=200,value=0, maximum=200,  mode="indeterminate")
        # Browse button
        #self.filename = StringVar()
        ttk.Button(InitFrame, text="Browse", command=self.browse_directory).grid(column=2, row=0, padx=10, pady=10,sticky="E")
        ttk.Button(InitFrame, text="Analyze!", command=self.pcap_analyse).grid(column=3, row=0, padx=10, pady=10,sticky="E")
        self.progressbar.grid(column=4, row=0, padx=10, pady=10, sticky="E")

        # Second Frame with Options
        SecondFrame = ttk.Frame(base,  width=50, padding="10 10 10 10",relief= GROOVE)
        SecondFrame.grid(column=10, row=20, sticky=(N, W, E, S))
        SecondFrame.columnconfigure(10, weight=1)
        SecondFrame.rowconfigure(10, weight=1)
        ttk.Label(SecondFrame, text="Options: ", style="BW.TLabel").grid(row=10,column=0,sticky="W")
        self.option = StringVar()
        self.options = {'All','HTTP','HTTPS','Tor','Malicious'}
        #self.option.set('Tor')
        ttk.OptionMenu(SecondFrame,self.option,"Select",*self.options).grid(row=10,column=1,sticky="W")
        self.zoom = [900,900]
        self.img = ""
        ttk.Button(SecondFrame, text="zoomIn", command=self.zoom_in).grid(row=10,column=10,padx=5,sticky="E")
        ttk.Button(SecondFrame, text="zoomOut", command=self.zoom_out).grid(row=10,column=11,sticky="E")

        # Third Frame with Results and Descriptioms
        self.ThirdFrame = ttk.Frame(base,  width=100, height=100, padding="10 10 10 10",relief= GROOVE)
        description = """It is a tool aimed to simplyfy the network analysis and speed the process of analysing the network traffic.\nThis prototype aims to accomplish 4 important modules,
                        \n 1. Web Traffic\n 2. Tor Traffic \n 3. Malicious Traffic \n 4. Device/Traffic Details\n\nPlease contact me @ spg349@nyu.edu for any bugs or problems !
                      """
        self.label = ttk.Label(self.ThirdFrame, text="Description: \nPcapXray tools is an aid for Network Forensics or Any Network Analysis!\n"+description, style="BW.TLabel")
        self.label.grid(column=10, row=10,sticky="W")
        self.xscrollbar = Scrollbar(self.ThirdFrame, orient=HORIZONTAL)
        self.xscrollbar.grid(row=100, column=0, sticky=E + W)
        self.yscrollbar = Scrollbar(self.ThirdFrame, orient=VERTICAL)
        self.yscrollbar.grid(row=0, column=100, sticky=N + S)
        self.ThirdFrame.grid(column=10, row=30, sticky=(N, W, E, S))
        self.ThirdFrame.columnconfigure(0, weight=1)
        self.ThirdFrame.rowconfigure(0, weight=1)
        self.name_servers = "" 
Example 5
Project: oss-ftp   Author: aliyun   File: test_widgets.py    License: MIT License 5 votes vote down vote up
def create(self, **kwargs):
        return ttk.Progressbar(self.root, **kwargs) 
Example 6
Project: content-downloader   Author: nikhilkumarsingh   File: gui.py    License: MIT License 5 votes vote down vote up
def task(ft):
	"""
	to create loading progress bar
	"""
	ft.pack(expand = True,  fill = BOTH,  side = TOP)
	pb_hD = ttk.Progressbar(ft, orient = 'horizontal', mode = 'indeterminate')
	pb_hD.pack(expand = True, fill = BOTH, side = TOP)
	pb_hD.start(50)
	ft.mainloop() 
Example 7
Project: sky3ds.py   Author: lukas2511   File: gui.py    License: MIT License 5 votes vote down vote up
def create_widgets(self):

        frame_master = Frame(self.window, padding = 5)

        label_message = Label(frame_master, text = self.message)
        label_message.pack()

        self.progress = ttk.Progressbar(frame_master, mode = self.mode, orient="horizontal", length = 300)
        self.progress.pack()
        self.progress['maximum'] = self.maximum

        frame_master.pack() 
Example 8
Project: goreviewpartner   Author: pnprog   File: toolbox.py    License: GNU General Public License v3.0 5 votes vote down vote up
def initialize_UI(self):


		if not self.move_range:
			self.move_range=range(1,self.max_move+1)



		root = self
		root.title('GoReviewPartner')
		root.protocol("WM_DELETE_WINDOW", self.close)

		bg=root.cget("background")
		logo = Canvas(root,bg=bg,width=5,height=5)
		logo.pack(fill=BOTH,expand=1,side=LEFT)
		logo.bind("<Configure>",lambda e: draw_logo(logo,e,"vertical"))

		right_frame=Frame(root)
		right_frame.pack(side=LEFT,padx=5, pady=5)
		self.right_frame=right_frame
		Label(right_frame,text=_("Analysis of: %s")%os.path.basename(self.filename)).pack()

		self.lab1=Label(right_frame)
		self.lab1.pack()

		self.lab2=Label(right_frame)
		self.lab2.pack()

		self.lab1.config(text=_("Currently at move %i/%i")%(1,self.max_move))

		self.pb = ttk.Progressbar(right_frame, orient="horizontal", length=250,maximum=self.max_move+1, mode="determinate")
		self.pb.pack()

		try:
			write_rsgf(self.rsgf_filename,self.g)
		except Exception,e:
			self.lab1.config(text=_("Aborted"))
			self.lab2.config(text="")
			raise e 
Example 9
Project: MacAdmins-2016-Craft-GUIs-with-Python-and-Tkinter   Author: brysontyrrell   File: 06_File_Uploader.py    License: MIT License 5 votes vote down vote up
def __init__(self, master, count):
        tk.Frame.__init__(self, master, borderwidth=5, relief='groove')
        self.grid(row=0, column=0)

        tk.Label(self, text="Your files are being uploaded").pack(padx=15, pady=10)

        self.progress = ttk.Progressbar(self, orient='horizontal', length=250, mode='determinate')
        self.progress.pack(padx=15, pady=10)
        self.progress['value'] = 0
        self.progress['maximum'] = count 
Example 10
Project: Tkinter-Projects   Author: Leohc92   File: main-gui.py    License: MIT License 5 votes vote down vote up
def create_console_frame(self):
		cnslfrm = Frame(self.root)
		photo = PhotoImage(file='icons/glassframe.gif')
		self.canvas = Canvas(cnslfrm, width=370, height=90)
		self.canvas.image = photo
		self.canvas.grid(row=1)
		self.console = self.canvas.create_image(0, 10, anchor=NW, image=photo)
		self.clock = self.canvas.create_text(32, 34, anchor=W, fill='#CBE4F6', font="DS-Digital 20", text="00:00")
		self.songname = self.canvas.create_text(115, 37, anchor=W, fill='#9CEDAC', font="Verdana 10", 
			text='\"Currently playing: none[00.00]\"')
		self.progressBar =  ttk.Progressbar(cnslfrm, length=1, mode="determinate")
		self.progressBar.grid(row=2, columnspan=10, sticky=W+E, padx=5)

		cnslfrm.grid(row=0, padx=0, pady=1) 
Example 11
Project: PokemonGo-DesktopMap   Author: mchristopher   File: test_widgets.py    License: MIT License 5 votes vote down vote up
def create(self, **kwargs):
        return ttk.Progressbar(self.root, **kwargs) 
Example 12
Project: content-downloader   Author: nikhilkumarsingh   File: gui_downloader.py    License: MIT License 4 votes vote down vote up
def __init__(self, frame, url, directory, min_file_size, max_file_size, no_redirects):
		global i_max
		global file_name
		global parallel

		self.url = url
		self.directory = directory
		self.min_file_size = min_file_size
		self.max_file_size = max_file_size
		self.no_redirects = no_redirects
		self.frame = frame

		self.progress = []
		self.str = []
		self.label = []
		self.bytes = []
		self.maxbytes = []
		self.thread = []

		if parallel:
			self.length = len(self.url) 
		else:
			# to serialize just make a single thread
			self.length = 1 

		# for parallel downloading
		for self.i in range(0, self.length):
			file_name.append("")
			i_max.append(0)
			total_chunks.append(0)

			# initialize progressbar
			self.progress.append(ttk.Progressbar(frame, orient="horizontal", 
								 length=300, mode="determinate"))
			self.progress[self.i].pack()
			self.str.append(StringVar())
			self.label.append(Label(frame, textvariable=self.str[self.i], width=40))
			self.label[self.i].pack()
			self.progress[self.i]["value"] = 0
			self.bytes.append(0)
			self.maxbytes.append(0)

		# start thread
		self.start() 
Example 13
Project: aws-inventory   Author: nccgroup   File: progress.py    License: Apache License 2.0 4 votes vote down vote up
def _create_widgets(self):
        # storage for widgets so we don't pollute GUI app instance namespace
        widget_space = collections.namedtuple('WidgetSpace', [
            'button_text',
            'button',
            'label_frame',
            'label_text',
            'label',
            'progress_bar',
            'status_label_text',
            'status_label'
        ])

        button_text = tk.StringVar(value='Start')
        button = ttk.Button(self, textvariable=button_text, command=self._start)
        button.pack()

        label_frame = ttk.LabelFrame(self, text='Service:Region')
        label_frame.pack(fill='x')

        label_text = tk.StringVar()
        label = ttk.Label(label_frame, anchor='w', textvariable=label_text)
        label.pack(fill='x')


        #XXX: add small fraction to max so progress bar doesn't wrap when work finishes
        progress_bar = ttk.Progressbar(
            self,
            orient='horizontal',
            length=self.master.winfo_screenwidth()/5,
            mode='determinate',
            maximum=self.work_count+1e-10
        )
        progress_bar.pack(fill='both')

        status_label_text = tk.StringVar(value='0 / {}'.format(self.work_count))
        status_label = ttk.Label(self, anchor='w', textvariable=status_label_text)
        status_label.pack(fill='x')

        return widget_space(button_text,
                            button,
                            label_frame,
                            label_text,
                            label,
                            progress_bar,
                            status_label_text,
                            status_label) 
Example 14
Project: DeepBrainSeg   Author: koriavinash1   File: DeepBrainSegUI.py    License: MIT License 4 votes vote down vote up
def init_scales(self, vol):
        """
        """
        self.slice1 = vol.shape[0]//2
        self.slice2 = vol.shape[1]//2
        self.slice3 = vol.shape[2]//2
        x_size, y_size, z_size = vol.shape

        self.Scale1 = tk.Scale(self.Frame10, from_=0.0, to=z_size)
        self.Scale1.place(relx=0.871, rely=0.025, relwidth=0.0, relheight=0.942
                , width=46, bordermode='ignore')
        self.Scale1.configure(activebackground="#f9f9f9")
        self.Scale1.configure(command=self.AxialScroll)
        self.Scale1.configure(length="368")
        self.Scale1.configure(troughcolor="#d9d9d9")


        self.Scale2 = tk.Scale(self.Frame11, from_=0.0, to=y_size)
        self.Scale2.place(relx=0.871, rely=0.025, relwidth=0.0, relheight=0.942
                , width=46, bordermode='ignore')
        self.Scale2.configure(activebackground="#f9f9f9")
        self.Scale2.configure(command=self.SagitalScroll)
        self.Scale2.configure(digits="50")
        self.Scale2.configure(length="368")
        self.Scale2.configure(troughcolor="#d9d9d9")


        self.Scale3 = tk.Scale(self.Frame12, from_=0.0, to=x_size)
        self.Scale3.place(relx=0.871, rely=0.025, relwidth=0.0, relheight=0.942
                , width=46, bordermode='ignore')
        self.Scale3.configure(activebackground="#f9f9f9")
        self.Scale3.configure(command=self.CorronalScroll)
        self.Scale3.configure(length="368")
        self.Scale3.configure(troughcolor="#d9d9d9")


        self.TProgressbar1 = ttk.Progressbar(self.Frame2)
        self.TProgressbar1.place(relx=0.007, rely=0.948, relwidth=0.981
                , relheight=0.0, height=19)
        self.TProgressbar1.configure(variable=self.progress_bar)

        self.overlay_flag = False


    # =================================================================