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

Резултати

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

Пребарај: #evacuation

当前筛选 #evacuation清除筛选
Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40339 · 16.12.2025 г., 11:00

Neon tetra fish form orderly queues when escaping through narrow spaces to avoid bumping into each other. Scientists observed groups of these fish passing calmly through small openings without clogging. This behavior helps them evacuate efficiently, unlike humans and sheep who often push and cause jams in emergencies. The study may help improve traffic flow and robot swarm designs. [Source] @googlefactss #FishBehavior🐟#Science#Evacuation#Nature#Research

International News

@intnewsagency · Post #8942 · 26.03.2026 г., 15:43

Evacuation at GES-2 Cultural Center in Moscow An evacuation is underway at the GES-2 Cultural Center in Moscow. Authorities have not yet disclosed the cause of the incident, and official information remains unavailable. Relevant services are actively ensuring the safety of visitors and staff. The situation is ongoing; stay tuned for updates. #Moscow#Evacuation#GES2#Incident The main news of Russia and the world ishere.

International News

@intnewsagency · Post #9239 · 05.04.2026 г., 14:35

Evacuation Underway in Makhachkala Due to Building Collapse Risk Residents of a multi-story building in Makhachkala are being evacuated amid fears the structure may collapse. Recent bad weather caused flooding across towns and villages in Dagestan, worsening regional infrastructure conditions. Local authorities are acting swiftly to ensure public safety. “Ensuring life support and safety is the republic’s priority,” officials stated. #Dagestan#Makhachkala#Evacuation#BadWeather#Safety The main news of Russia and the world ishere.