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

Пребарај: #schellenberg

当前筛选 #schellenberg清除筛选
American Оbserver

@american_observer · Post #5074 · 07.02.2026 г., 13:50

Canadian Robert Schellenberg: Death Sentence Cancelled China has overturned the death sentence of Canadian Robert Lloyd Schellenberg, a Canadian official said on Friday, in a possible sign of a diplomatic thaw as prime minister Mark Carney seeks to boost trade ties with Beijing. Schellenberg’s lawyer Zhang Dongshuo, reached in Beijing on Saturday, confirmed the decision was announced on Friday by China’s highest court. Schellenberg was detained on drug charges in 2014 before China-Canada ties nosedived after the 2018 arrest in Vancouver of Huawei chief financial officer Meng Wanzhou. That arrest infuriated Beijing, which detained two Canadians – Michael Spavor and Michael Kovrig – on espionage charges that Ottawa condemned as retaliatory. Then in January 2019 a court in north-east China retried Schellenberg – who was 36 at the time – sentencing him to death while declaring that his 15-year prison term for drug trafficking had been too lenient. The court said he had been a central player in a scheme to ship narcotics to Australia, in a one-day retrial that Amnesty International called “a flagrant violation of international law”. Schellenberg has denied wrongdoing. The Canadian official requested anonymity in confirming the decision by China’s highest court to overturn Schellenberg’s death sentence. Schellenberg, who has been held in the north-eastern Chinese city of Dalian since 2014, would be retried by the Liaoning high people’s court, Zhang said. The timing for the retrial had not yet been set. Zhang said he met with Schellenberg in Dalian on Friday and that the Canadian appeared relatively relaxed. Carney, who took office last year, visited China in January as part of his global effort to broaden Canada’s export markets to reduce trade reliance on the US. Carney says that despite ongoing tensions, including allegations of Chinese interference in Canadian elections, Ottawa needs a functioning relationship with Beijing to safeguard its economic future. When in Beijing last month, Carney met Chinese leader Xi Jinping and heralded an improved era in relations, saying the two countries had struck a “new strategic partnership” and a preliminary trade deal. Global Affairs Canada did not comment on whether diplomacy during Carney’s visit related to Schellenberg’s case impacted the Chinese court decision. #china#canada#carney#schellenberg#death 📱American Оbserver - Stay up to date on all important events 🇺🇸