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

Пребарај: #stuntlegend

当前筛选 #stuntlegend清除筛选

🪂🔥 Tom Cruise sets fire to the sky in South Africa — literally! In 2023, the Mission: Impossible star broke a Guinness World Record for performing 16 consecutive parachute jumps — with a twist: his main chute was on fire!🔥 Where did this madness take place? 📍South Africa’s Drakensberg mountains. Cruise jumped from a helicopter at 7,500 ft (≈2,300 m), lit his parachute on fire mid-air, then safely deployed a backup chute — 16 times in a row. 😳 Oh, and there’s more. He also did a wing-walking stunt on a biplane, and at one point couldn’t get back inside — because he was too exhausted. 🎬 All of this for Mission: Impossible – The Final Reckoning (Part 2). No green screens. No stunt doubles. Just Cruise being... Cruise. #TomCruise#MissionImpossible#StuntLegend#SouthAfrica#ParachuteJump#Drakensberg#GuinnessWorldRecord