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

Резултати

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

Пребарај: #centralafricanrepublic

当前筛选 #centralafricanrepublic清除筛选
RTDocumentary

@rtdocumentary · Post #139 · 25.07.2021 г., 10:00

Testimony of an ex-child soldier #video#CentralAfricanRepublic In the Central African Republic, thousands of children have joined violent militias – either by force, or by choice. Since 2013, the country has been locked in civil war, with several disparate groups fighting each other. Some kids have joined the Christian Anti-balaka group and wear elaborate amulets to protect them against guns. Others fight for Seleka Muslim rebels with AK-47s. As part of a UNICEF-led effort to free child soldiers over the years, thousands of underage soldiers have left the groups. However, children traumatised by war have to go through a rehabilitation process before going home. This child who we filmed for Children of the Front shared his memories. Follow: https://t.me/rtdocumentary

Venture Village Wall 🦄

@venturevillagewall · Post #4111 · 10.02.2025 г., 07:00

Arweave AO Live, CAR Meme Token Launch Arweave’s computing platform AO is now active on its mainnet, enhancing decentralized applications. More info: The Block. In crypto news, the President of the Central African Republic, Faustin-Archange Touadéra, announced the launch of a meme token named CAR, reaching a market cap close to $900 million shortly after release. However, the token's legitimacy is questioned due to reported hacks and potential issues with its announcement video being AI-generated. Further details: Forklog. Analysts forecast significant declines for new token issuances, expecting drops of over 80% post-listing. Read more: Wu Blockchain News. #Arweave#DeFi#Crypto#Token#Market#Launch#CentralAfricanRepublic#MemeToken#Touadera#AI#Analyst#Predict#Listing#Invest#Blockchain#Ethereum#ETH