Longxiang Lyu thinks this is interesting: 10-3. Guest: From Chapter 10: Files and Exceptions from Python Crash Course by Eric Matthes Publisher: No Starch Press Released: November 2015 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") Share this highlight http://www.safaribooksonline.com/a/python-crash-course/10836524/ Twitter Facebook Google Plus Email Get Instant Access Now Start a Free Trial Have an account? Sign in. Minimise Unlock the rest of Python Crash Course and 30,000 other books and videos By clicking this box, you confirm that you have read and agree to the terms and conditions of our Membership Agreement, and you understand that when your trial period ends, you will be required to provide billing information if you wish to continue using the service. Unlock the rest of this book Start a Free 10-Day Trial loading Learn about Safari for Business Have an account? Sign in.