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

Резултати

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

Пребарај: #dogdata

当前筛选 #dogdata清除筛选

DogData community🐾 Everyone should be interested in getting this. Let's show that we are big, let's show that our community is huge ❗️❗️ Support us and vote for DogData🙏🐾 Please tag 👇 @FaceBook4Dog#ethbn#bone#dogdata https://twitter.com/gate_io/status/1293863802019119105?s=09 👆👆👆

🚨🚨TODAY 🚨🚨 #26 July 2020 LIVE AMA🤩📣 #DogData CFO Thomas Melchior With the support #EXCOINCIAL Team 🔴Get your questions prepared. 🔴 Maximum 2 questions per person. THE EVENT HOSTED ON #AFRICUNIA TV Facebook: https://www.facebook.com/africuniatv Instagram: https://www.instagram.com/africuniatv Zoom: https://zoom.us/j/6331039454

$Dogs token is the governance token for Kennel.Ai platform Web3 on chain platform Where pet dog breeders can tokenise pet dogs using NFT Blockchain is the best way to decentralise dog data Blockchain has created for pet dog breeders the opportunity to manage the industry themselves instead of having to pay and being governed by a centralised organisation #DogData#FCI#DogBreeder#blockchain#Decentralised

$Dogs token is the governance token for Kennel.Ai platform Web3 on chain platform Where pet dog breeders can tokenise pet dogs using NFT Blockchain is the best way to decentralise dog data Blockchain has created for pet dog breeders the opportunity to manage the industry themselves instead of having to pay and being governed by a centralised organisation #DogData#FCI#DogBreeder#blockchain#Decentralised

ПретходнаСтраница 1 од 3Следна