#NEWLINE# def get_username( prompt = 'Enter username: ' , defaultUser = None ) : #NEWLINE# #INDENT# 'Prompt for a username, allowing pre-populated *defaultUser*.' #NEWLINE# user = raw_input ( prompt ) #NEWLINE# while ( not len ( user ) ) : #NEWLINE# #INDENT# if defaultUser : #NEWLINE# #INDENT# user = user #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# user = raw_input ( '  You must enter a username: ' ) #NEWLINE# #UNINDENT# #UNINDENT# return user