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

Резултати

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

Пребарај: #internationalmountainday

当前筛选 #internationalmountainday清除筛选
Space Universe🌌

@spaceuniverses · Post #28 · 27.12.2021 г., 15:00

Happy #InternationalMountainDay! ⛰ Hubble viewed its very own celestial "Mystic Mountain" in the Carina Nebula. This three-light-year-tall pillar of gas and dust is located about 7,500 light-years away from us. This infrared view shows reveals stars behind the gaseous veil of the nebula's wall of hydrogen, laced with dust. The foreground pillar becomes semi-transparent because infrared light from background stars penetrates through much of the dust. And if you haven't heard: The NASA Webb Space Telescope launches later this month, and with its powerful infrared capabilities, we’ll see spectacular infrared views of our universe! Image credits: NASA, ESA, and M. Livio and the Hubble 20th Anniversary Team (STScI)

Green University CA | Official

@centralasian_greenuniversity · Post #515 · 11.12.2025 г., 10:55

🏔️International Mountain Day 🗓Today, we celebrate International Mountain Day — a reminder of the incredible role mountains play in our lives. They provide fresh water, protect unique ecosystems, and inspire millions around the world. 🌱Let’s raise awareness, appreciate nature, and work together to preserve these powerful landscapes for future generations. #InternationalMountainDay#SustainableFuture#GreenUniversity#YouthForNature#EcoAwareness ✉️[email protected] ☎️ +998 55 512 00 77 📍Location 🌐Website | 📱Telegram | 📱Instagram | 📱LinkedIn | 🟥YouTube

🏔 11-декабрь — Эл аралык тоолор күнү 🏔 11 декабря — Международный день гор 🏔 December 11 — International Mountain Day #Kyrgyzstan#InternationalMountainDay#MountainsMatter #ProtectOurMountains#SustainableMountains #MountainLife#MountainCommunities #MountainEcosystems#UNMountainDay #LoveMountains#Mountains2025 https://youtu.be/7X56VFPic0s?si=3gZ6YYqkZ1L8v6G-