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

Пребарај: #landscapeandarchitecture

当前筛选 #landscapeandarchitecture清除筛选

Rambla Climate-House. "The Rambla Climate-House works as a climatic and ecological device. It is part of a series of associative initiatives, developed at the scale of independent citizens, to contribute to reparations for the environmental and climate damage caused by over urbanization in Molina de Segura. The Rambla Climate-House collects pooled rainfall from its roofs and greywater from its showers and sinks to spray onto the Rambla's remains and regenerate their former ecologic and climatic constitution. The house is organized around this elliptical section of rambla, as an observatory in alliance to this reconstructed landscape and as a sequence of interconnected spaces of different widths." (c) Architecture: Andrés Jaque / Office for Political Innovation, Miguel Mesa del Castillo Photography: José Hevia 2021 #ArchDaily#house#houses#landscaping#landscapeandarchitecture#arch_shovel