Размер видео: 1280 X 720853 X 480640 X 360
Показать панель управления
Автовоспроизведение
Автоповтор
# Python writing files (.txt, .json, .csv)# --------- .txt ---------txt_data = "I like pizza!"file_path = "output.txt"try: with open(file_path, 'w') as file: file.write(txt_data) print(f".txt file '{file_path}' has been created successfully")except FileExistsError: print("That file already exists")# --------- .json ---------import jsonemployee = { "name": "Spongebob", "age": 30, "job": "Cook"}file_path = "output.json"try: with open(file_path, 'w') as file: json.dump(employee, file, indent=4) print(f"JSON file '{file_path}' has been created successfully")except FileExistsError: print("That file already exists!")# --------- .csv---------import csvemployees = [["Name", "Age", "Job"], ["Spongebob", 30, "Cook"], ["Patrick", 37, "Unemployed"], ["Sandy", 27, "Scientist"]]file_path = "output.csv"try: with open(file_path, "w", newline="") as file: writer = csv.writer(file) for row in employees: writer.writerow(row) print(f"csv file '{file_path}' was created")except FileExistsError: print("That file already exists!")
Been learning python through your 12 hr vid and its helped alot
Nuke codes folder lmao, bro is the cultured teacher xD
It's a joke bro
Great video! Also glad to know that you're a souls fan
3:18 Nuclear Launch Codes 😂😂😂😂😂😂😂😂 FBI OPEN UP ! 🚓🚓
Лаба твои инсайды просто бомба! Жду новых идей.
Thank you bro code . I know nothing about python yet , I'm currently learning JavaScript through your free JavaScript course. And I'm here to thank you ❤❤❤❤
Thank you bro code that was very helpful!!!
New in here... Eager to learn about coding
Bro is a souls player
much appreciated Bro
thats useful bro can you do a free course about data structures and algorithms java pls bro i beg you
refer take you forward
Thanks bro
Why is python allowed to do all this
I was gonna like the video but it has 69 likes so i wont ruin it, anyways W vid
Hi this video is 🎉🎉
# Python writing files (.txt, .json, .csv)
# --------- .txt ---------
txt_data = "I like pizza!"
file_path = "output.txt"
try:
with open(file_path, 'w') as file:
file.write(txt_data)
print(f".txt file '{file_path}' has been created successfully")
except FileExistsError:
print("That file already exists")
# --------- .json ---------
import json
employee = {
"name": "Spongebob",
"age": 30,
"job": "Cook"
}
file_path = "output.json"
try:
with open(file_path, 'w') as file:
json.dump(employee, file, indent=4)
print(f"JSON file '{file_path}' has been created successfully")
except FileExistsError:
print("That file already exists!")
# --------- .csv---------
import csv
employees = [["Name", "Age", "Job"],
["Spongebob", 30, "Cook"],
["Patrick", 37, "Unemployed"],
["Sandy", 27, "Scientist"]]
file_path = "output.csv"
try:
with open(file_path, "w", newline="") as file:
writer = csv.writer(file)
for row in employees:
writer.writerow(row)
print(f"csv file '{file_path}' was created")
except FileExistsError:
print("That file already exists!")
Been learning python through your 12 hr vid and its helped alot
Nuke codes folder lmao, bro is the cultured teacher xD
It's a joke bro
Great video! Also glad to know that you're a souls fan
3:18 Nuclear Launch Codes 😂😂😂😂😂😂😂😂
FBI OPEN UP ! 🚓🚓
Лаба твои инсайды просто бомба! Жду новых идей.
Thank you bro code . I know nothing about python yet , I'm currently learning JavaScript through your free JavaScript course. And I'm here to thank you ❤❤❤❤
Thank you bro code that was very helpful!!!
New in here... Eager to learn about coding
Bro is a souls player
much appreciated Bro
thats useful bro
can you do a free course about data structures and algorithms java pls bro i beg you
refer take you forward
Thanks bro
Why is python allowed to do all this
I was gonna like the video but it has 69 likes so i wont ruin it, anyways W vid
Hi this video is 🎉🎉