1. Запись в файл:
with open("file.txt", "w") as f:
f.write("Hello, world!")
2. Чтение из файла:
with open("file.txt", "r") as f:
content = f.read()
print(content)
CO CodeShadow @codeshadowcources · 77 subscribers
with open("file.txt", "w") as f:
f.write("Hello, world!")
with open("file.txt", "r") as f:
content = f.read()
print(content)