Python write a file 📝

preview_player
Показать описание
Python writing files tutorial example explained

#python #writing #files

text = "Yooooooooo\nThis is some text\nHave a good one!\n"

Рекомендации по теме
Комментарии
Автор

text = is some text\nHave a good one!\n"

with open('test.txt', 'w') as file:
file.write(text)

BroCodez
Автор

To add to what's been taught, you can write non-string text to a file by simply converting it to a string before writing. Example:
someDictionary = { “one”:1, “two”:2, “three”:3, “nine plus ten”:21 }
someString = str(someDictionary) *#you** can now file.write(someString)*

with open("someFileName.txt", "w") as file:
file.write(someString)

jadenataylor
Автор

i think i'm addicted to the voice. man you are the best👏

ShellonceChikuni
Автор

You in ma heart bro. You magic Bro code, I can undesterstand everything with ya!

fabricioprincipe
Автор

thank you so much that was really helpful !!

NabilNabil-yykm
Автор

can you read and write at the same time.

davehug
Автор

Bro please please teach to generate pdfs

youngmagician
join shbcf.ru