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

Резултати

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

Пребарај: #pulkovo

当前筛选 #pulkovo清除筛选
International News

@intnewsagency · Post #9334 · 17.04.2026 г., 05:23

Key Update at 08:00: International Agenda and Security Pulkovo airport halts flights due to a drone attack, highlighting rising regional security threats. Russian drones strike Ukrainian targets amid ongoing special operations. The US delays arms deliveries to Europe, focusing on tensions with Iran. A major success: the launch of the Soyuz-2.1b rocket from Plesetsk carrying military satellites, boosting national defense. “Security remains a priority in challenging times.” #Russia#Security#InternationalNews#Pulkovo#SpecialOperation The main news of Russia and the world ishere.

International News

@intnewsagency · Post #8801 · 22.03.2026 г., 16:40

Pulkovo Airport Resumes Normal Operations Pulkovo Airport in Saint Petersburg has fully returned to regular operations after temporary restrictions. According to @interfaxonline, all flights are now operating on schedule, ensuring reliable connections between the city, other Russian regions, and international destinations. The airport’s restored functioning supports the normalization of transport infrastructure and boosts the region’s business activity. #Pulkovo#aviation#SaintPetersburg#transport#news The main news of Russia and the world ishere.

dopingpong

@dopingram · Post #2554 · 02.07.2023 г., 09:10

«Детская любовь к самолетам», 70х100см, холст, масло, Doping Pong, 2023 Аукцион VLADEY RUSSIA Живые торги в зале! Участие онлайн и по телефону Трансляция на сайте 4 июля в 20:00 Предаукционная выставка: 23 июня — 4 июля C 11:00 До 22:00, без выходных VLADEY Неглинная, 14 стр. 1А, вход 4 More info: Лот 62 https://vladey.net/ru/lot/10768 #dopingpong#ussr#retro#aeroflot#childhood#love#airplane#pulkovo#oiloncanvas