Advertisement
Guest User

Untitled

a guest
Apr 16th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.32 KB | None | 0 0
  1. #Functions start
  2. import time
  3.  
  4.  
  5. print "==========================="
  6. print "Welcome to Phoenix Studios!"
  7. print "==========================="
  8. print "Enter a username and password"
  9. username = raw_input("Username: ")
  10. password = raw_input("Password: ")
  11.  
  12. def Main():
  13.  
  14. commands = {
  15. "[INFO]": "Information about developer",
  16. "[PHOENIX]": "Phoenix Studios information",
  17. "[VERSION]": "Version of OS",
  18. "[QUIT]" : "Exit program",
  19. }
  20.  
  21. info = {
  22. "[INFO]" : "This is software developed and\nmaintained by Junaid Talpur"
  23. }
  24.  
  25. version = {
  26. "[VERSION]" : "0.9.5"
  27. }
  28.  
  29. print "Welcome in!"
  30. print "Type 'help' for assistance"
  31. while True:
  32. print "\n"
  33. command = raw_input("Command:")
  34.  
  35. if command == "help":
  36. print "==============[COMMANDS]==========="
  37. for key in commands:
  38.  
  39. print(key + " : " + commands[key])
  40. print "==================================="
  41.  
  42. if command == "info":
  43. print "==============[INFO]=============="
  44. for key in info:
  45. print(info[key])
  46. print "=================================="
  47.  
  48. if command == "version":
  49. print "==============[VERSION]==========="
  50. for key in version:
  51. print(key + " : " + version[key])
  52. now = time.strftime("%I:%M:%S")
  53. print "[DATE RELEASED] : 3/27/2017"
  54. print "[Current date] : " + time.strftime("%x")
  55. print ("[Current time] : %s" % now )
  56. print "=================================="
  57.  
  58. if command == "quit":
  59. print "Saving user data..."
  60. time.sleep(2)
  61. print "Signing out..."
  62. time.sleep(1)
  63.  
  64.  
  65.  
  66.  
  67. def Welcome():
  68. print "Welcome in!"
  69. print "Please enter your login info, to make sure its you"
  70. username = raw_input("Username: ")
  71. password = raw_input("Password: ")
  72. file = open("Login.txt", "r")
  73. if username and password != "":
  74. for line in file.readlines():
  75. line = line.strip()
  76. if str(line) == username and password:
  77. Main()
  78. else:
  79. print "Register again"
  80. Register()
  81. #(2)
  82. def Pass():
  83. file = open("Login.txt", "r")
  84.  
  85. if username and password != "":
  86. for line in file.readlines():
  87. line = line.strip()
  88. if str(line) == password:
  89. print "Pass found", line
  90. Welcome()
  91. else:
  92. print "Invalid"
  93. #(1)
  94. def Login():
  95. file = open("Login.txt", "r")
  96.  
  97. if username and password != "":
  98. for line in file.readlines():
  99. line = line.strip()
  100. if str(line) == username:
  101. print "User found", line
  102. Pass()
  103.  
  104. else:
  105. print "Invalid try again"
  106. Login()
  107.  
  108. file.close()
  109.  
  110. Login()
  111.  
  112.  
  113. def Register():
  114. counter = 0
  115. list = ['yes','YES','Yes']
  116. print "[Yes][No]"
  117. print "User not registered, register now?"
  118. answer = raw_input(":")
  119. if answer in list:
  120. print "Ok"
  121. counter +=1
  122. print "Enter login info"
  123. username = raw_input("Username: ")
  124. password = raw_input("Password: ")
  125. file = open("Login.txt", "a")
  126. print >>file, "[Data]", counter
  127. print >>file, (username), "\n"
  128. print >>file, (password), "\n"
  129. file.close()
  130. else:
  131. print "Quitting..."
  132.  
  133. Register()
  134.  
  135. #(3)
  136. def Welcome():
  137. print "Welcome in!"
  138. print "Please enter your login info, to make sure its you"
  139. username = raw_input("Username: ")
  140. password = raw_input("Password: ")
  141. file = open("Login.txt", "r")
  142. if username and password != "":
  143. for line in file.readlines():
  144. line = line.strip()
  145. if str(line) == username and password:
  146. print "User found"
  147. print line
  148. else:
  149. print "Register again"
  150. Register()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement