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

Резултати

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

Пребарај: #cityscape

当前筛选 #cityscape清除筛选
International Geographic

@internationalgeographic · Post #5600 · 14.04.2025 г., 03:56

📍 Nighttime in Singapore 🇸🇬 View of the Marina Bay Sands hotel 🌆 Singapore is an island nation in Southeast Asia. Founded as a British trading colony in 1819, after gaining independence it became one of the most prosperous countries, with the world's leading trading port. A fascinating fact: Singapore is the world's only island city-state! 🏙️🌴 #travel#wanderlust#cityscape

Amazing Geography 🌍

@amazingeo · Post #104 · 23.08.2025 г., 20:12

🌍 Hong Kong’s extensive network of elevated walkways—some stretching over 800 meters—lets people travel between major buildings without ever touching the street, maximizing space in the crowded city. ✨ #urban⚡#planning⚡#cityscape⚡#infrastructure⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

🌴Victoria Embankment in Durban is one of the city’s most iconic waterfront areas — both a major transport route and a symbol of urban identity. 🌆 📍 Along the Embankment you’ll find: 🔹 the famous John Ross House with the Roma Revolving Restaurant 🔹 Durban’s city hall and court buildings 🔹 the historic yacht basin 🔹 monuments, greenery, and sweeping views of the bay 🚶‍♀️ It’s a perfect place for walks, photos, and taking in the rhythm of Durban’s harbor life — where colonial history meets modern African energy. 📹 Video #Durban#VictoriaEmbankment#SouthAfrica#Cityscape#Waterfront#History#UrbanAfrica#TravelSouthAfrica#Architecture#JohnRossHouse#ExploreDurban

Discover Tashkent in autumn over the decades. From Petrov’s paintings to Soviet and modern photography, see how Uzbekistan’s capital evolved. https://yep.uz/en/2025/09/tashkent-autumn-20th-21st-century/ #tashkent#autumn#vladimirpetrov#paintings#sovietphotography#20thcentury#21stcentury#cityscape#history#uzbekistan