Advertisement
Guest User

Untitled

a guest
May 29th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. import sys, time
  2. print "Welcome to your personal notemaker."
  3.  
  4. operation = input("Choose operation:\n1) Make a new file\n2) Write to an existing file\nAwaiting command: ")
  5.  
  6. while True:
  7.     username = raw_input("Enter username: ")
  8.     if username == 'Mikesch':
  9.         password = raw_input("Enter password: ")
  10.         if password == 'wazakindjes':
  11.             print "Logged in."
  12.             break
  13.         else:
  14.             print "Wrong password/username. Access denied."
  15.             sys.exit(1)
  16.  
  17. if operation == 1:
  18.     filename = raw_input("Enter a filename(with extension): ")
  19.     creating = open(filename, "w")
  20.     note     = raw_input("Enter your note(type \\n for a new line): ")
  21.     creating.write(note)
  22.     creating.close()
  23.     print "Note token successfully. Exiting program..."
  24.     time.sleep(2)
  25.     sys.exit(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement