التعامل مع الملفات في بايثون
تعلّم قراءة وكتابة الملفات النصية، وأهمية إغلاقها بأمان باستخدام with.
🐍 Try Python right here
Write code below and click Run — it executes right in your browser, nothing is sent to any server.
Output will appear here.
الدروس
1
قراءة الملفات سطرًا بسطر
يمكنك المرور على ملف نصي سطرًا بسطر باستخدام حلقة for مباشرة على كائن الملف المفتوح.
✏️ Practice this lesson:
Output will appear here.