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

Пребарај: #anc113

当前筛选 #anc113清除筛选
Russian Consulate in Cape Town

@rusconct · Post #2143 · 12.01.2025 г., 14:08

🇷🇺🇿🇦Ambassador of Russia to South Africa Roman Ambarov attended the celebration of the 113th anniversary of the formation of the African National Congress in Cape Town. «To quote Oliver Tambo, the formation of the ANC was a continuation in Southern Africa, under new historic conditions, of the anti-colonial and national liberation struggles which had begun with the advent of colonialism. The Soviet Union, throughout its entire history, consistently stood for the elimination of colonialism and supported liberation movements in Africa and across the globe,” the Ambassador said on the sidelines of the event. “However, the work on decolonization spearheaded by the USSR in the XX century was not finished. And today Russia and South Africa are among the most vigorous supporters of anti-neocolonial policies,” Roman Ambarov pointed out. 🤝The ANC participates in the work of the international forum “For the Freedom of Nations!” seeking to wipe out modern practices of neocolonialism. In Dec 2024, Pretoria voted for the UNGA resolution on the eradication of colonialism in all its forms and manifestations. “We hope our collaboration will help mobilize all responsible members of the international community to uphold justice in world affairs,” the Ambassador added. #RussiaSouthAfrica#RussiaSArelations#StopColonialism#StopColonialismNow#Ambarov#ANC113Anniversary#ANC113@MYANC