/
2.PopupApp.py
71 lines (49 loc) · 1.67 KB
/
2.PopupApp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#qpy:kivy
from kivy.app import App #here we are import app from kivy.app
from kivy.uix.boxlayout import BoxLayout #here we are importing boxlayout
from kivy.lang import Builder #here we are importing builder
from kivy.uix.button import Button #here we are importing button from kivy UI
from kivy.uix.popup import Popup #popup imported from UI
from kivy.uix.label import Label #label imported from UI
from kivy.uix.progressbar import ProgressBar #progressbar imported
import time #Imported TIME to show time in progressbar
import threading #threading so more then 1 thing can run together.
Builder.load_string('''
<Myinterface>:
orientation: 'vertical'
Label:
text: "Hi There"
BoxLayout:
orientation: 'vertical'
TextInput:
id: variable
hint_text: "Enter your username"
MyButton:
user_input: variable.text
text: "Attack"
on_release: self.do_action()
''')
class MyInterface(BoxLayout):
pass
class MyButton(Button):
def progbar(self):
pb = ProgressBar()
popup = Popup(title='Brute Forcing ...', content=pb, size_hint=(0.7, 0.3))
popup.open()
time.sleep(2)
pb.value = 25
time.sleep(4)
pb.value = 50
time.sleep(6)
pb.value = 75
time.sleep(8)
pb.value = 100 #value becomes 100 of progressbar.
def do_action(self, *args):
threading.Thread(target=self.progbar).start()
print 'We are here'
return
class MyApp(App):
def build(self):
return MyInterface()
MyApp().run() #runs or starts our app.
#please subscribe www.youtube.com/priyankgada