TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #214 · 12 фев.

Как правильно проверить атрибуты доступа файла? То есть доступна ли запись в файл или является ли он исполняемым? Для этого в Python есть функция os.access() Проверять так: os.access(path, flag) Функция вернёт bool в зависимости от наличия указанного флага. Всего есть 4 флага проверки: os.F_OK - наличие файла на диске os.R_OK - доступ на чтение os.W_OK - доступ на запись os.X_OK - доступ на исполнение Например, вместо try-except лучше делать так (пример из документации): if os.access("myfile", os.R_OK): with open("myfile") as fp: return fp.read() #basic#libs

Hashtags

Резултати

Пронајдени 1 слични објави

Пребарај: #recycleandcreate

当前筛选 #recycleandcreate清除筛选
Teach For Uzbekistan | Official

@teachforuzbekistan · Post #272 · 23.07.2025 г., 14:34

♻️ Yozgi institut ishtirokchilari ekologiyani asrash g‘oyasini real hayotda sinab ko‘rishlari uchun Ecology Day o‘tkazildi. 🗳 Ular oddiy qog‘oz, karton va plastik idishlardan hayratlanarli ijodiy ishlarni yasashdi. 🌍 Kimdir chiroyli guldon yasagan bo‘lsa, 🔧 kimdir foydali uy jihozi yoki o‘yinchoq, 🏠 yana kimdir qushlar uchun chiroyli uycha yasadi. 👥 Jarayonning o‘zi ham juda quvonarli va do‘stona muhitda o‘tdi. 💚 Ijodiy ishlarda ishtirok etganlar yashil kelajak uchun mas’uliyat hissi va jamoaviylikni yanada mustahkamladilar. 💬💬💬🗣 ♻️ To experience environmental care in action, our participants celebrated Ecology Day by turning everyday materials like paper, cardboard, and plastic bottles into creative and useful items. 🎨 Some made beautiful vases, 🛠 others created handy household items or toys, 🏡 and a few even crafted birdhouses! 👥 The entire process took place in a joyful, friendly atmosphere. 💚 Those who took part strengthened their sense of responsibility for a greener future and the value of teamwork. #EcologyDay#GreenFuture#SummerInstitute#TeachForUzbekistan#Sustainability#RecycleAndCreate