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

Резултати

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

Пребарај: #selftalk

当前筛选 #selftalk清除筛选
Quiet World 🍁

@QuietWorld · Post #8028 · 18.03.2022 г., 01:37

You may feel down, anxiety may attack you multiple times sometimes out of nowhere. Overthinking may come & try to get you. Go & sit in meditation, just let it flow through you, & pick yourself up. Yes, sometimes you gotta pick yourself up. If you seek to be understood, it is more likely that people can't see through your lens. But why bother, you don't need validation from others on how you feel. If you vent to the wrong person, you may end up in worser condition than before you vent it at the first place. You don't need to vent out to everyone you know, you don't need to vent out to all your close friends & family members. If you need to, choose only one. Talk to your angels. Call upon your higher self. They got your back. note: just an advice to myself in my situation. #thoughts#selftalk@quietworld🍃