O'Reilly logo
  • Longxiang Lyu thinks this is interesting:

10-3. Guest:

From

Cover of Python Crash Course

Note

filename = 'users.txt'

with open(filename, 'a') as file_object:
while True:
flag = raw_input('\nenter Y/y if you want to proceed to enter usernames: ')
if flag != 'Y' and flag != 'y':
break
user = raw_input('name: ')
file_object.write(user + "\n")