Opening, writing to, and closing a text file in Python. Use the 'open' built-in function and pass

preview_player
Показать описание
Opening, writing to, and closing a text file in Python. Use the "open" built-in function and pass the filename together with the mode, in which you'd like to open a file. The "x" mode rises an exception if the file already exists.

#openfile #writefile #file #textfile #closefile
#python #python3 #development #developer #programming #it #coding #program #programmer #programminglanguage #code #coding #pythonprogramming #pythoncode #software
#softwaredeveloper #geek #computers #learntocode #learnpython
Рекомендации по теме
Комментарии
Автор

Thnx dude, even though I knew this was possible and needed to use it but i was just too lazy to search, and then this popped up lol

smhaseeb
Автор

Dude you’re awesome keep in that way, thanks 😊

raulzelaya
Автор

Use with for context management...opening and closing a file is not recommended

JavierVegaPerry
Автор

this is not good form. use "with open(file) as (name):" so you don't have to close it

EnderFlop
Автор

You have not shown f.truncate () and f.seek () and the r+ mode

Human_ver-..
Автор

Pleaaasse tell me the name of the background music pleeaase..

keithbacalso
Автор

This is bad code! You should use a with statement. You should delete this tutorial!

רועיכהן-כתובתישנה
join shbcf.ru