Первая директория в 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
🎤 Great news! 🌟 We are excited to announce the launch of our new public speaking course at ADC! 🏫
If you want to overcome the fear of public speaking, improve your presentation skills, or simply become a more effective communicator, our course is designed for you. With experienced instructors, a supportive environment, and a program focused on real-life success, we are here to help you find your voice and make an impact.
👩🏫👨🏫 Join us on a journey of development, confidence, and empowerment. Classes are starting soon, and spaces are limited, so book your spot today!
☎️For more details:
74 2261078
74 2281121
74 2281666
74 2276163
74 2252536
#PublicSpeaking#FindYourVoice#Empowerment#CommunicationSkills#Education#NewCourse#JoinUs
Mass-media fondi direktori bilan darslar
📚 Mass-media fondi direktori, tajribali media mutaxassisi Jahongir Azimov “Yozgi institut”imizda ishtirokchilarga maxsus darslar o‘tdilar.
💬 Mashg‘ulotlarda “Teamwork and Collaboration” (Jamoaviy ish va hamkorlik) hamda “Effective Communication Techniques” (Samarali muloqot usullari) mavzulari yoritildi. Ishtirokchilar jamoada samarali ishlash, o‘z fikrini ravon yetkazish va professional muomala ko‘nikmalarini amaliy mashqlar orqali rivojlantirdilar.
🤝 Bu darslar bilim boʻlibgina qolmay, kelgusida ishtirokchilarimiz uchun amalda eng foydali tajribalarga ham ega boʻlishdek imkoniyatni yaratdi. Jahongir Azimovga vaqtlarini ayamay kelgani va biz bilan ulashgan bilimlari uchun samimiy minnatdorchiligimizni bildiramiz!
💬💬💬🗣
Sessions with the Director of the Mass Media Foundation
📚 The Director of the National Mass Media Foundation and experienced media specialist Jahongir Azimov held special sessions for participants at our “Summer Institute”.
💬 The sessions covered the topics of “Teamwork and Collaboration” and “Effective Communication Techniques.” Participants enhanced their skills in effective teamwork, clear self-expression, and professional communication through practical exercises.
🤝 These sessions not only provided knowledge but also created an opportunity for our participants to gain valuable experiences that will be beneficial in their future careers. We sincerely thank Jahongir Azimov for taking the time to visit and share his knowledge with us!
#TeachForUzbekistan#SummerInstitute#MediaLeadership#CommunicationSkills#Teamwork#JahongirAzimov#MassMediaSupport#YozgiInstitut#IlhomVaTajriba