Python File Handling

File Handling

Đọc và ghi files, xử lý dữ liệu từ file

⏱️ 120 phút📊 Trung bình

📂 File I/O cơ bản

# Đọc file
with open("data.txt", "r", encoding="utf-8") as file:
content = file.read()
print(content)

# Ghi file
with open("output.txt", "w", encoding="utf-8") as file:
file.write("Xin chào Python!")

💻 Bài tập thực hành

📊 Bài 1: Log Analyzer

Phân tích file log và thống kê

💾 Bài 2: Data Backup

Tạo hệ thống backup dữ liệu

📋 Bài 3: Report Generator

Tạo báo cáo từ dữ liệu CSV