Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global conf
- with open('system_data.txt') as json_file:
- for y in json.load(json_file):
- conf = str(y['boot_config'])
- def start():
- global login, conf
- with open(f'user.txt') as json_output:
- data = json.load(json_output)
- global t, login_en, passwd_en
- for t in data:
- login_en = t['login']
- passwd_en = t['password']
- global root, anim_speed
- with open(f'config_{conf}.txt') as json_file:
- data = json.load(json_file)
- for p in data:
- root = bool(p['root'])
- anim_speed = float(p['anim_speed'])
- if (login_en, passwd_en) == ('new', 'new'):
- login = input ('Enter new login: ')
- passwd = input ('Enter new password: ')
- user_data = {}
- user_data['user_data'] = []
- user_data['user_data'].append({
- 'login': login,
- 'password': passwd
- })
- with open('user.txt', 'w') as out_json:
- json.dump(user_data['user_data'], out_json)
- os.system('cls')
- print ('New account created!')
- time.sleep(1)
- welcome()
- else:
- login = input('Enter login: ')
- if login == '_':
- conf = input ('config_')
- try:
- with open(f'config_{conf}.txt') as json_file:
- data = json.load(json_file)
- for p in data:
- root = bool(p['root'])
- anim_speed = float(p['anim_speed'])
- start()
- except:
- print ('ConfigNotFoundError! Choose another config!')
- start()
- password = input ('Enter password: ')
- if (login, password) == (login_en, passwd_en):
- welcome()
- else:
- print ('----------------------------------------\n'
- '| You entered wrong login or password! |\n'
- '----------------------------------------')
- start()
- .......
- def main():
- os.system('cls')
- global root
- global password
- global login
- global version
- global conf
- version = 'AMT OS v.3.2 alpha 2.3.2 build 23'
- print(
- f'-------------------------------------\n| {version} |\n--------------------------------------------------------'
- f'----\n| Enter "commands" to see command list |\n| Enter "info" to get information about '
- f'system |\n------------------------------------------------------------')
- inp_sym = f'{login}|> ' if root == False else f'root|{login}|> '
- command = input (inp_sym).split()
- '''
- и при этом выскакивает ошибка, что в inp_sym переменная root не найдена
- '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement