@LiveHealthy · Post #6940 · 24.01.2025 г., 00:52
#happiness
Hashtags
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
Пребарај: #happiness
@LiveHealthy · Post #6940 · 24.01.2025 г., 00:52
#happiness
Hashtags
@QuietWorld · Post #6796 · 26.10.2019 г., 08:30
The first recipe to happiness is to avoid lengthy meditation of the past. 🍃 #happiness@quietworld🍃
Hashtags
@QuietWorld · Post #6787 · 25.10.2019 г., 08:30
Happiness will never come to those who never appreciate what they already have. #happiness@quietworld🍃
Hashtags
@QuietWorld · Post #6756 · 20.10.2019 г., 23:30
Recall it as often as you wish, a happy memory never wears out. —Libbie Fudim #happiness@quietworld🍃
Hashtags
@QuietWorld · Post #6738 · 18.10.2019 г., 23:30
The word 'happiness' would lose its meaning if it were not balanced by sadness. – Carl Jung #happiness@quietworld🍃
Hashtags
@talks · Post #286 · 26.05.2018 г., 11:46
#happiness
Hashtags
@QuietWorld · Post #6772 · 23.10.2019 г., 08:30
Thousands of candles can be lighted from a single candle & the life of the candle will not be shortened. Happiness never decreased by being shared. – Buddha – but of course this doesn't apply to all kinds of happiness though, for example; I would surely be less happy if I were to share a husband with someone🧐 #happiness#thoughts @quietworld🍃
Hashtags
@QuietWorld · Post #6617 · 28.09.2019 г., 03:58
Happiness is not the absence of problems, but the ability to deal with them. #happiness#quotes @quietworld🍃
Hashtags
@QuietWorld · Post #6797 · 26.10.2019 г., 13:00
Happiness doesn't come from doing easy work but from the afterglow of satisfaction that comes after the achievement of a difficult task that demanded our best. #happiness#motivation @quietworld🍃
Hashtags
@QuietWorld · Post #7474 · 08.07.2020 г., 04:02
My ex-schoolmates, ex-collegemates, ex-everything on social media: • getting married • celebrating their first pregnancy • flexing new expensive car • flexing their lover • flexing their expensive pets 😍 Me: • happily flexing the stray kittens I adopted 🥰 The amount of happiness, is same 🥰 Just make sure you know what actually makes you happy 😄💐 What makes you happy? Comment down below.😉 #thoughts#life#happiness @quietworld🍃
Hashtags
@gumiho_wallpaper · Post #866 · 21.10.2024 г., 00:10
#Kdrama #Happiness
Hashtags
@QuietWorld · Post #6739 · 19.10.2019 г., 06:30
"Everyone wants happiness, nobody wants pains, but you can't have the rainbow, without a little rain." #happiness#selfreminder @quietworld🍃
Hashtags