1#Simple Mood Diary Script As An Example#
2
3print('My Mood Diary')
4mood = input('How are you feeling today? ')
5#Saves the input as the variable 'mood'#
6text_file = open("MoodDiary.txt", "w")
7#Opens or creates the .txt file, sharing the directory of the script#
8text_file.write(mood)
9#Writes the variable into the .txt file#
10text_file.close()
11#Closes the .txt file#
12
1Simple Mood Diary Script As An Example#
2
3print('My Mood Diary')
4mood = input('How are you feeling today? ')
5#Saves the input as the variable 'mood'#
6text_file = open("MoodDiary.txt", "w")
7#Opens or creates the .txt file, sharing the directory of the script#
8text_file.write(mood)
9#Writes the variable into the .txt file#
10text_file.close()
11#Closes the .txt file#
12