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

Резултати

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

Пребарај: #thisiswhatarealmuseumlookslike

当前筛选 #thisiswhatarealmuseumlookslike清除筛选
Beyond Moscow

@beyondmoscow · Post #360 · 20.07.2025 г., 11:27

This is the rib of a bowhead whale. The skull of a polar bear. A narwhal’s tusk. A nest of an eider duck — complete with an egg from which a chick once hatched. All of them real. All of them 2,000 to 5,000 years old. All of them from the Arctic islands of Franz Josef Land. And just imagine — they sit millimeters from your eyes. Where else can you examine whale baleen or every tiny crack in the fearsome tusks of a walrus? Not even in the wild is that possible. That’s why I made my way to 📌the Arctic Embassy in #Arkhangelsk — which normally doesn’t open on weekends, but thanks to the wonderful staffer Elena, it opened just for me. This is the main visitor center of the “Russian Arctic” National Park — the northernmost specially protected nature reserve in Russia. It includes the archipelagos of Novaya Zemlya and Franz Josef Land, and the Embassy houses remarkable finds from both. It’s a genuinely one-of-a-kind #thisiswhatarealmuseumlookslike — focused entirely on one region. Here, you can see corals and volcanic rocks aged 200 to 500 million years, collected from islands in the Arctic Ocean, and trace the gripping history of their exploration. Chills run down your spine when you see fragments of a 16th-century Barents expedition boat, old chess pieces, coffee beans, skis, crates of canned food, and handwritten journals from explorers and scientists from the USSR, Norway, Scotland, and the U.S. And just like them, you feel an unstoppable urge to see the Russian Arctic with your own eyes — no matter how high the price. 🏙️Beyond Moscow🏔️