Первая директория в 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
⚠️ Blogerlar uchun YANGILIK: Captions kompaniyasi yangi Mirage texnologiyasini taqdim etdi. Neyron tarmoq noldan odamlarni yaratadi va ovozni video formatiga maksimal aniq oʻgiradi.
😱 Bu haqiqiy inqilob! Boshqa modellar faqat lablarni harakatlantirsa, Mirage hammasini qiladi:
✅ Tana modelini yaratadi
✅ Haqiqiydan ajratib bo'lmaydigan harakatlar
✅ Fon
✅ Tabiiy mimika
➡️https://www.captions.ai/mirage
➡️#ai#captions | Birinchi raqamli IT-Blog
· · • • • •❄️• · · INSTAGRAM · · •❄️• • • • · ·
Escribir captions en Instagram es un arte y es una excelente manera de impulsar el compromiso por parte de tu comunidad.
Tus descripciones son representaciones de tu marca. Y podrían ser la última pieza que necesitas mejorar para pasar de un feed bueno a uno profesional. De hecho, escribir captions en Instagram podría ser la clave para que tu publicación gane visibilidad. Así que lee estos Tips para escribir captions en Instagram y luego me cuentas que te parecen 😉.
#tips_instagram
#captions
· · • • • • • · · · · • • • ☃️• • • · · · · • • • • • · ·
· · • • • •🌼• · · INSTAGRAM · · •🌼• • • • · ·
Uno de los beneficios de los posts en Instagram es que puedes cargar fotografías, diseños, videos e incluso galerías de hasta 10 imágenes juntas. En este caso la clave es que lo que sea que uses como portada sea lo suficientemente atractivo para que los usuarios se detengan a leer tu caption.
#tips_instagram
#captions#consejos
· · • • • • • · · · · • • • 🍃• • • · · · · • • • • • · ·
#python#asr#captions#cli#python#subtitle#subtitles#transcript#transcripts#translating_transcripts#youtube#youtube_api#youtube_asr#youtube_captions#youtube_subtitles#youtube_transcript#youtube_transcripts#youtube_video
The YouTube Transcript API is a tool that helps you get the text from YouTube videos. It's fast and easy to use, saving you time compared to watching the whole video. You can use it to make subtitles, translate text, and even analyze what's being said in videos. This is helpful for content creators who want to make their videos more accessible and for researchers who need to study video content quickly. It also supports multiple languages, making it useful for a wide range of users.
https://github.com/jdepoix/youtube-transcript-api