SkoolOS/run.py
Raffu Khondaker a0a58164ac basic login
2020-06-04 15:53:19 -04:00

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!")