I am creating an app using python (kivy and kivymd) and I have a login screen but every time I open my application I will get this screen,how can I make to appear once and disappear permanently?
Login Screen kivy/kivymd
331 views Asked by Yidnek At
2
There are 2 answers
0

The following code will help:
It tries to read a 'temp.txt' file
On first run , there is no such file and an exception will be thrown calling the except block
Code:
global k
try:
with open('temp.txt','r') as file:
p = file.read()
global k
k = False
except:
global k
with open('temp.txt','w') as file:
file.write('1')
k = True
class Management(ScreenManager):
def __init__(self,*kwargs):
global k
if k:
self.current = 'LoginScreen'
else:
self.current = 'HomeScreen'
Use a config file to store the information to decide whether to open the login screen.