Files
Python-HV/Pass3/2 files.py
2018-04-26 15:42:16 +02:00

14 lines
235 B
Python
Executable File

file = open("log.txt","w")
file.write("Hej världen!!\n")
file.write("Lite mer text")
file.close()
file = open("log.txt","r")
print(file.read())
#with open("log.txt") as file:
#data = file.read()
#do something with data