mirror of
https://github.com/Rushilwiz/SkoolOS.git
synced 2025-04-16 02:10:19 -04:00
31 lines
670 B
Python
31 lines
670 B
Python
from __future__ import print_function, unicode_literals
|
|
from PyInquirer import prompt, print_json
|
|
import os
|
|
|
|
def login():
|
|
questions = [
|
|
{
|
|
'type': 'input',
|
|
'name': 'user_name',
|
|
'message': 'What\'s your first name',
|
|
},
|
|
{
|
|
'type': 'password',
|
|
'name': 'passwd',
|
|
'message': 'Password?',
|
|
},
|
|
]
|
|
answers = prompt(questions)
|
|
print(answers)
|
|
f = open(".login.txt", "w")
|
|
f.write(str(answers["user_name"]))
|
|
print_json(answers) # use the answers as input for your app
|
|
|
|
if(os.path.exists(".login.txt") == False):
|
|
login()
|
|
else:
|
|
print("Hello!")
|
|
|
|
|
|
|