I'm working on a program for school that asks the user what they would like to name a file and then I'm supposed to write to that file.
So far I have this:
dream_file = input("What file name would you like to save the cards? ")
dream_file = open(dream_file, 'w')
dream_file.write(str(dream_hand1))
print(dream_file)
dream_file.close()
When I run it I get this error: <_io.TextIOWrapper name='dream' mode='w' encoding='US-ASCII'>
And as far as I know the file never gets created.
dream_hand1? Are you sure this is your entire relevant code?<_io.TextIOWrapper name='dream' mode='w' encoding='US-ASCII'>is not an error; it's the output ofprint(dream_file)