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

Пребарај: #cryptolessons

当前筛选 #cryptolessons清除筛选
TON Crypto News

@toncoin_rap · Post #176 · 26.09.2024 г., 12:01

🎧⤴ 🐹Tapped for Months, Earned Pennies: Hamster Combat's Epic Letdown😁 After months of relentless tapping, eager "hamsters" finally witnessed the listing of Hamster Combat. These devoted tappers dreamed of millions and luxurious yachts, but reality hit hard when the coin's value failed to meet expectations. Instead of fortune, participants are left with a mere $15 — or even less — in their pockets. This ironic twist highlights the pitfalls of hoping to get rich simply by tapping a phone screen. Chorus: Tapped the screen, chased the dream so far, But all we got was a fading star. Promises of millions turned to dust, Hamster wheels that lost our trust. Verse 1: Half a year we tapped away, Fingers numb every single day. Hamster Combat was the name, Thought we'd rise to wealth and fame. Dreams of yachts and cash in hand, Building castles made of sand. Listing day, the curtain's drawn, Fifteen bucks and illusions gone. Chorus: Tapped the screen, chased the dream so far, But all we got was a fading star. Promises of millions turned to dust, Hamster wheels that lost our trust. Verse 2: Believed the hype, we took the ride, Blinded by that crypto tide. Tapping screens like it was gold, Never thought the truth be told. Hamster races led nowhere, Woke up from that millionaire's dare. Pocket change is all we found, Feet now firmly on the ground. Chorus: Tapped the screen, chased the dream so far, But all we got was a fading star. Promises of millions turned to dust, Hamster wheels that lost our trust. Verse 3: Lessons learned, the hard school's best, There's no shortcut to the crest. Tap and hope won't pay the bills, Real work earns the real thrills. Chasing coins in cyberspace, Never again will we embrace. Time to step off hamster tracks, Focus on the real facts. Chorus: Tapped the screen, chased the dream so far, But all we got was a fading star. Promises of millions turned to dust, Hamster wheels that lost our trust. Bridge: We woke up from that digital trance, No more betting on a chance. Hamster Combat wrote the end, Now it's time our ways to mend. #CryptoReality#HamsterCombat#CryptoLessons #TONCryptoNewsRapStyle 🎧@toncoin_rap