“Python speichern die Eingabe in die Textdatei” Code-Antworten

Python speichern die Eingabe in die Textdatei

#Simple Mood Diary Script As An Example#

print('My Mood Diary')
mood = input('How are you feeling today? ')
#Saves the input as the variable 'mood'#
text_file = open("MoodDiary.txt", "w")
#Opens or creates the .txt file, sharing the directory of the script#
text_file.write(mood)
#Writes the variable into the .txt file#
text_file.close()
#Closes the .txt file#
Ruukasu

Python speichern die Eingabe in die Textdatei

Simple Mood Diary Script As An Example#

print('My Mood Diary')
mood = input('How are you feeling today? ')
#Saves the input as the variable 'mood'#
text_file = open("MoodDiary.txt", "w")
#Opens or creates the .txt file, sharing the directory of the script#
text_file.write(mood)
#Writes the variable into the .txt file#
text_file.close()
#Closes the .txt file#
Combative Caribou

Ähnliche Antworten wie “Python speichern die Eingabe in die Textdatei”

Fragen ähnlich wie “Python speichern die Eingabe in die Textdatei”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen