Advertisement
c0d3dsk1lls

Progress bar type 1

Aug 3rd, 2022 (edited)
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 6.58 KB | None | 0 0
  1. ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++##
  2. ##=======================================================================================================================================================================================##
  3. ##----------------------CODEDSKILLS.NET--------------------------------------------------------------------------------------------------------------------------------------------------##
  4. #-------PROGRESS BAR----------#
  5. #-----------------------------#
  6. from tkinter import * #-------#
  7. from tkinter.ttk import *     #
  8. import time    #--------------#
  9. def start():   #
  10.     tasks = 10 #
  11.     x = 0 #----#--------#
  12.     while(x<tasks):     #
  13.         time.sleep(1)   #
  14.         bar["value"]+=10#
  15.         x+=1 #----------#------------------------#
  16.         percent.set(str(int((x/tasks)*100))+"%") #------------#
  17.         text.set(str(x)+"/"+str(tasks)+"tasks completed")     #
  18.         window.update_idletasks() #---------------------------#
  19. #---------------------------------#
  20. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++
  21. #-------------------------------------------#
  22. window = Tk() #-----------------------------#
  23. percent = StringVar() #---------------------#
  24. text = StringVar() #------------------------#
  25. bar = Progressbar(window,orient=HORIZONTAL) #
  26. bar.pack(pady=10) #-------------------------#----------------------#
  27. percentLabel = Label(window,textvariable=percent).pack() #---------#
  28. taskLabel = Label(window,textvariable=text).pack() #---------------#
  29. button = Button(window,text="download",command=start).pack()       #
  30. window.mainloop()   #----------------------------------------------#
  31. #-------------------#
  32. ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++##
  33. ##=================================================================================================================================================##
  34. ##-------------------------------------------------------------------------------------------------------------------------------------------------##
  35. ##                                                                                                                                                 ##
  36. ##                                                                                        ##   //                                                  ##
  37. ##----+-#########\   ########  -+#######\\-- +##########   #######\\        /#######\\    ##  //     ######---+-##      ##       /#######\\        ##
  38. ##      ##-          ##|--|##    ##-     ##   ##           ##-     ##      ||-----        ## //        ##       ##----+-##      ||-----         +--##
  39. ##      ##           ##|  |##  -+##    +--##  #######      ##       ##  -- \\#######\\    ## \\        ##       ##      ##------\\#######\\-------+##
  40. ##      ##-        +-##|--|##    ##-     ##   ##           ##-     ##         ------||    ##  \\       ##       ##      ##         ------||--------##
  41. ##      #########/   ########  -#######//-  -+##########   #######//       \\######//     ##   \\    ######---+-#####   #####   \\######//------+--##
  42. ##                                                                                                                                                 ##
  43. ##                                                          https://CodedSkills.net                                                                ##
  44. ##-------------------------------------------------------------------------------------------------------------------------------------------------##
  45. ##=================================================================================================================================================##
  46. ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++##
  47.  
  48.  
  49. ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++##
  50. ##=======================================================================================================================================================================================##
  51. ##---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------##
  52. ##                                                                                                                                                                                       ##
  53. ##           ###       #######\    #######\       #######       ########     ##  ##     ########     ########       #######     ########       ####        ##         /#######\\         ##
  54. ##          #-##            //          //        \   //    =      ##        ##  ##        ##        ##|--|##       ##  //         ##         //  \\       ##        ||-                 ##
  55. ##            ##          ##\\        ##\\           //            ##        ##  ##        ##        ##|  |##       ###\\          ##        //====\\      ##        \\#######\\         ##
  56. ##            ##            //          //          //             ##        ##  ##        ##        ##|--|##       ##  \\         ##       //      \\     ##                 ||         ##
  57. ##       ##########   ########--  ########--       //       =      ##         ####         ##        ########       ##   \\     ########   //        \\    #######   \\######//          ##
  58. ##                                                                                                                                                                                       ##
  59. ##                                                                         https://1337tutorials.net                                                                                     ##
  60. ##---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------##
  61. ##=======================================================================================================================================================================================##
  62. ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++##
  63.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement