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

Пребарај: #mealprep

当前筛选 #mealprep清除筛选
Dishes.Cooking.Food

@cookingdish · Post #588 · 22.11.2024 г., 14:50

High Protein Quinoa Balls Recipe🥗💪 Ingredients for Quinoa Balls: 🥣 75g quinoa 🌿 3 tsp canola oil 🧅 1 red onion 🧄 2 cloves garlic 🥕 1 small carrot 🌾 10g rolled oats (tender) 🌱 35g soy granules 🫚 1 tsp vegetable broth 🌽 2 tbsp cornstarch 🌿 1 handful of parsley Ingredients for Filling: 🌿 1 handful of chives 🌱 1 tbsp vegan cream cheese 🍋 Quarter lemon Spices: 🧂 Salt 🌶️ Chili 🧂 Pepper Preparation🥘: 1️⃣ Cook the quinoa & soy granules according to the packaging. Then drain each one. 2️⃣ Chop onions & garlic 🧅🧄 and sauté in 1 tsp canola oil. 3️⃣ Grate or finely chop the carrots 🥕 and add to the pan for 3 minutes. Finely chop parsley 🌿. 4️⃣ Mix quinoa, soy granules, onions, garlic, carrots, oats, vegetable broth, parsley & cornstarch in a bowl 🥣. Leave to swell for 3 minutes. 5️⃣ Prepare the filling: mix vegan cream cheese, lemon juice 🍋, and chives 🌿. Season. 6️⃣ Season the quinoa mixture, form 5 balls, press in with your thumb, fill with the dip, and close the balls. 7️⃣ Fry the balls in 2 tbsp canola oil until golden. ✨Enjoy your high-protein snack!💪🌱 #HealthyEating#VeganRecipe#ProteinBoost#QuinoaBalls#PlantBased#MealPrep @dishes

Dishes.Cooking.Food

@cookingdish · Post #557 · 23.10.2024 г., 13:27

High Protein Red Cabbage Rolls Ingredients: 🥬 1 large red cabbage 🫚 4 cm ginger 🧄 3 cloves of garlic 🥕 2 carrots 🫑 2 peppers 🧅 2 spring onions 🌱 100 g soy granules 🍶 50 ml soy sauce Toppings: ✨ Sesame, 🌿 fresh parsley, 🌶 chili flakes Dip: 🍯 Sweet Chili Sauce #HighProtein#RedCabbageRolls#HealthyEating#PlantBased#EasyRecipe#SoyGranules#VeggiePower#Flavorful#MealPrep @dishes