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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #281 · 18 авг.

Что-то вы гоните насчет "привычного вида формата 755 и 644". Я вот вообще не понял что это!😳 Действительно, что означают цифры которые мы получили в прошлом посте? Это кодировка, заключающая в себе режимы доступа к файлу. Подробней можно почитать в статье про chmod. Там можно увидеть альтернативное обозначение того же самого с помощью символов r w x, что значит чтение, запись, исполнение. Чтобы преобразовать восьмеричное число в такое обозначение в Python есть готовая функция >>> stat.filemode(0o755) '?rwxr-xr-x' Мы видим 3 группы по 3 символа, дающие 3 типа доступа для 3 типов юзеров. А что за знак вопроса в начале? Давайте передадим в эту функцию необрезанное значение от os.stat >>> stat.filemode(os.stat(path).st_mode) 'drwxr-xr-x' Это данные, которые мы безжалостно обрезали в прошлый раз😼 Первый символ обозначает тип объекта. Это может быть файл (-), директория (d) или симлинк (l). Вот простая схема данной кодировки [1][3][3][3] │ │ │ │ │ │ │ └──> Others Permissions │ │ └─────> Group Permissions │ └────────> Owner Permissions └───────────> File Type (разверните экран если вы с телефона) Если вы попробуете получить пермишены для симлинка то получите пермишены для файла >>> path = '.venv/bin/python3' >>> stat.filemode(os.stat(path).st_mode) '-rwxr-xr-x' Чтобы получить свойства именно симлинка, нужно это явно указать >>> stat.filemode(os.stat(path, follow_symlinks=False).st_mode) 'lrwxrwxrwx' #tricks#basic

Резултати

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

Пребарај: #ants

当前筛选 #ants清除筛选
Interesting Planet 🌍

@interesting_planet_facts · Post #754 · 15.09.2025 г., 13:22

🌎 Leafcutter ants and certain fungi share a remarkable partnership. Ants bring leaves underground—not to eat, but to feed a specific fungus they cultivate as food. This mutualism has existed for over 50 million years, making it one of the oldest known examples of symbiosis in the animal world. ✨ #symbiosis⚡#ants⚡#evolution 👉subscribe Interesting Planet ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1386 · 27.04.2026 г., 12:11

🌎 Leafcutter ants farm fungus by cutting leaves and bringing them to underground nests. The ants feed the fungus, then eat the fungus as their main food source. Over 47 species of leafcutter ants are found in Central and South America. ✨ #symbiosis⚡#ants⚡#nature 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1242 · 21.01.2026 г., 12:11

🌎 Army ants in Central and South America show remarkable cooperation by forming living bridges with their bodies. These bridges help the colony cross gaps during raids. Colonies can contain over 200,000 worker ants acting as a single super-organism. ✨ #ants⚡#cooperation⚡#symbiosis 👉subscribe Interesting Planet 👉more Channels ​

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40309 · 12.12.2025 г., 23:01

Ants don't have lungs. They breathe through tiny holes along the sides of their bodies called spiracles. These connect to a network of tubes (tracheae) that deliver oxygen directly to their tissues. [Read more] @googlefactss #Ants#Biology#Entomology#ScienceFacts

Interesting Planet 🌍

@interesting_planet_facts · Post #476 · 31.07.2025 г., 20:22

🌎 The leafcutter ant creates underground gardens by carrying fresh leaves to feed a special fungus, which is their true food. This farming partnership has evolved over millions of years, making these ants nature’s original farmers long before humans. ✨ #ants⚡#fungus⚡#agriculture 👉subscribe Interesting Planet