Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #imports
- from kivy.app import App
- from kivy.core.window import Window
- from kivy.uix.button import Button
- from kivy.uix.floatlayout import FloatLayout
- from kivy.uix.gridlayout import GridLayout
- from kivy.uix.label import Label
- from kivy.uix.scrollview import ScrollView
- from kivy.uix.textinput import TextInput
- import Functions
- import sys
- import time
- class Home(FloatLayout):
- #function that setups the first page
- def setup(self, obj):
- self.clear_widgets()
- List = Button(
- text="Your List",
- font_size=20,
- size_hint=(1/6, 1/12),
- pos_hint={"x":2.5/6, "y":1/6},
- on_press = self.LIISST
- )
- self.add_widget(List)
- #function that lists tasks
- def LIISST(self, obj):
- self.clear_widgets()
- FUNC_ = Functions.Choose_("GE", 5)
- FUNC_.sort()
- LT = GridLayout(
- cols=1,
- spacing=10,
- size_hint_y=None,
- )
- LT.bind(minimum_height=LT.setter('height'))
- SCR = ScrollView(
- size_hint=(1/3.5, 2/3),
- pos=(self.width*137/384, self.height/3.25)
- )
- for i in range(len(FUNC_)):
- but_ = Button(text=str(FUNC_[i]),
- size_hint=(18/20, None),
- height=40,
- font_size=self.width/75,
- on_press=lambda s:Functions.Choose_("DE", but_.text)
- )
- LT.add_widget(but_)
- SCR.add_widget(LT)
- ACC_ = Button(
- text="Back",
- font_size=20,
- size_hint=(1/8, 1/14),
- pos_hint={"x":3.5/8, "y":1/6},
- on_press=self.setup
- )
- self.add_widget(SCR)
- self.add_widget(ACC_)
- def __init__(self, **kwargs):
- super(Home, self).__init__(**kwargs)
- Window.clearcolor = (255/255, 255/255, 255/255, 255/255)
- self.setup(self)
- class App_(App):
- def build(root):
- return Home()
- if __name__ == '__main__':
- App_().run()
- import random
- import sys
- def Choose_(vall_, VAAL_):
- try:
- #variables
- cfile = open(r"Choice.txt", "r+")
- cfile.seek(0)
- dfile = open(r"Done.txt", "r+")
- dfile.seek(0)
- items = []
- DON = []
- #appenders for items in file to line
- [items.append(line) for line in cfile]
- [DON.append(line) for line in dfile]
- stripp1 = [s.strip() for s in items]
- stripp2 = [s.strip() for s in DON]
- stripp1.sort()
- stripp2.sort()
- if vall_ == "DE":
- print(VAAL_)
- if vall_ == "GE":
- return stripp1
- sys.exit()
- for s in stripp2:
- if s in stripp1:
- stripp1.remove(s)
- if not stripp1:
- dfile.seek(0)
- dfile.truncate(0)
- return False
- sys.exit()
- luck = random.randint(0, (len(stripp1)-1))
- dfile.write(stripp1[luck])
- dfile.write("n")
- return(stripp1[luck])
- finally:
- cfile.close()
- dfile.close()
- ClIP STUDIO PAINT
- CYBRARY (HACKING)
- CYBRARY (LINUX)
- VIRTUAL DJ
- RASPBERRY PI
- PACKET TRACER
- VIRTUALBOX
- PHOTOSHOP
- BLENDER
- SOLIDWORKS
- KHAN ACADEMY (ANATOMY)
- SOLOLEARN
- UNITY
- KHAN ACADEMY (ELECTRICAL)
- PROGRAMMING
- KHAN ACADEMY (PHYSICS)
- ADOBE PREMIERE
- ClIP STUDIO PAINT
- CYBRARY (HACKING)
- CYBRARY (LINUX)
- VIRTUAL DJ
- RASPBERRY PI
- PACKET TRACER
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement