Advertisement
c0d3dsk1lls

Progress bar type 2

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