TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #198 · 6 јан.

Первая директория в sys.path 🔸 Когда вы запускаете Python-интерпретатор в интерактивном режиме, в системные пути (sys.path) в самое начало добавляется текущая рабочая директория >>> for path in sys.path: ... print(f'"{path}"') "" "/usr/lib/python37.zip" "/usr/lib/python3.7" ... Первая строка пустая, что и означает текущую рабочую директорию. 🔸 Если вы запускаете интерпретатор передавая скрипт как аргумент, то история получается иная. На первом месте будет директория в которой располагается скрипт. А текущая рабочая директория игнорируется. Пишем скрипт с таким содержанием: # script.py import sys for path in sys.path: print(f'"{path}"') Запускаем python3 /home/user/dev/script.py Получаем "/home/user/dev" "/usr/lib/python37.zip" "/usr/lib/python3.7" ... 🔸 Если вы запускаете скрипт по имени модуля то на первом месте будет домашняя директория текущего юзера python3 -m script "/home/user" "/usr/lib/python37.zip" "/usr/lib/python3.7" ... Скрипт должен быть доступен для импорта На что это влияет? На видимость модулей для импорта. Если вы ждёте, что, запустив скрипт по пути, сможете импортировать модули из текущей рабочей директории, то вы ошибаетесь. Придётся добавлять путь os.getcwd() в sys.path самостоятельно или заранее объявлять переменную PYTHONPATH. #basic

Hashtags

Резултати

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

Пребарај: #independenceday

当前筛选 #independenceday清除筛选
MPA GLOBAL

@mpa_creative · Post #196 · 01.09.2022 г., 10:49

Ассалому алайкум Ахли ватандошим! Энг улуғ Энг азиз аём Мустақиллигимизнинг 31 йиллиги байрами билан барчангизни самимий муборакбод этаман сиҳат-саломатлик, хонадонларингизга файзу барака ва фаровонлик тилайман. Мустақил Ватанимизнинг тинчлиги, гуллаб-яшнаши ҳамда равнақи йўлида олиб бораётган фаолиятингизда омад ва зафарлар ёр бўлсин! Мустақиллик истиқлолимиз абадий бўлсин! Хурмат билан Нафосат! #independenceday#uzbekistan🇺🇿 @nafosat_uz

स्वतंत्रता दिवस के अवसर पर प्रधानमंत्री नरेंद्र मोदी ने लाल किले की प्राचीर से विकसित भारत के लक्ष्य को प्राप्त करने हेतु देशवासियों के साथ कई लक्ष्य निर्धारित किए। आइए इस 🧵 द्वारा जानें... #IndependenceDay #PMModi

Russian MFA 🇷🇺

@MFARUSSIA · Post #28218 · 04.02.2026 г., 08:03

🇱🇰On February 4, Sri Lanka celebrates Independence Day - a defining moment in the country’s history. On this day back in 1948, Ceylon (officially renamed Sri Lanka in 1972) gained independence from the British rule, ending nearly 450 years of European colonial domination by the Portuguese, Dutch, and British. Independence was achieved through constitutional means, making Sri Lanka one of the first countries in South Asia to peacefully secure sovereignty through negotiation. 📝 Colonial policies, including the British “divide and rule” approach and the plantation-based economic model, significantly reshaped the island’s social structure and economy, with long-term consequences for interethnic relations and development. The independence movement was driven by political leaders, youth organizations, trade unions, and the Buddhist revival movement, which played a key role in preserving national identity, language, and cultural traditions. Sri Lanka, being one of the founding members of Non-Aligned Movement, has been steadily following a non-aligned foreign policy and remains an active participant in international and regional organizations. 🤝Diplomatic relations between our country and Sri Lanka were established on February 19, 1957. Over the decades, bilateral cooperation has expanded in areas such as education, culture, humanitarian exchanges, and people-to-people contacts, developing in a spirit of friendship, trust, and mutual respect. 💬Levan Dzhagaryan, Ambassador of Russia to Sri Lanka: I warmly congratulate the people of Sri Lanka on their national holiday and wish the country peace, stability, prosperity, and continued development. #SriLanka#IndependenceDay

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