Ok, so if I am reading it right, you want code in python so you enter in a name and it stores it into a txt file for later use:
import os.path
if os.path.exists("storage.txt"): # Check if the file "storage.txt" exists,
a = open("storage.txt", "r+") # Open the file storage.txt, we know it exists because of the previous line ^
hi = a.read(-1); # Change -1 to how many letters to read, -1 means everything
print ("Hi, your username is - "+ str(hi)) # Show your name,
changename = input("Would you like to change your name? - ").lower() # Ask to change name, .lower means make it all lowercase.
if changename == "yes":
username = input("Hello, enter in your name please - ")
print ("Your username is now - "+ str(username))
a = open("storage.txt", "w") # Open storage.txt for writing in the new username
a.write(username) # Write the new username to the file.
a.close() # Close the file.
else:
print ("Bye,")
else:
username = input("Hello, enter in your name please - ") # Enter a string for the variable username
a = open("Storage.txt", "w") # Check if a file with that name exists, if not creates the file. "W" means write
a.write(username) # Puts in storage.txt what the variable username is.
a.close() # Close file
print ("Your username is -", username) # Print username
This is python 3.3 also.