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 слични објави

Пребарај: #onflow

当前筛选 #onflow清除筛选
DWF Labs Broadcast

@DWFLabs · Post #198 · 07.02.2023 г., 05:07

We're a proud sponsor of the first Flow Hackathon – a global competition from 2/21–2/26 to push the limits of #web3#onFlow. Beyond excited to be involved in the expansion of the #ecosystem and to provide an opportunity for developers to shine! 💡✨ This is what's up: 💰 $500K in prizes 🌐 Virtual & IRL events 📚 Education phase to learn more about building #onFlow ✨ Amazing speakers and judges 👨‍💻 Empowering #developers to do great things Are you ready to build awesome innovations and earn prizes for your work? Register today! 👇 https://hackathon.flow.com