Ранее мы уже говорили о том, как выполнить какой-либо код перед открытием интерактивной консоли.
Расскажу еще один способ! На самом деле, даже запустив интерпретатор в обычном режиме с выполнением скрипта из файла вы можете в любом месте активировать интерактивный режим. Или даже несколько по очереди. За это отвечает модуль code.
Как это может пригодиться?
🔸 Вам не хватает pdb и хочется больше "власти"
🔸 Нужно запросить у юзера данные в достаточно сложном виде. В этом случае можно попросить его создать что ему надо и сохранить в определённую переменную, с которой потом и работать.
🔸 Нужна изолированная среда для выполнения каких-либо действий.
🔸 Просто забавы ради😁
Запускается консоль очень просто
import code
ic = code.InteractiveConsole()
try:
ic.interact()
except SystemExit:
pass
Выход обратно на предыдущий уровень происходит как обычно, вызов функции exit() или клавиши Ctrl+D(Ctrl+Z для Windows).
Я набросал простой пример с некоторым функционалом
🔹 Меняются символы приглашения
🔹 В неймспейсы добавляются дополнительные объекты
🔹 Считается время, проведённое в интерактивном режиме
🔹 Скрипт просит юзера заполнить переменную и по выходу распечатывает её значение
Код здесь ↗️
Для запуска сохраните код в файл и запускайте как обычный скрипт.
python my_console.py
Для быстрого запуска можно сделать отдельный алиас
alias py="python3 /home/username/my_console.py"
#tricks#source
Мы запустили видеоаналитику — новый продукт для бизнеса, меняющий подход к безопасности и анализу данных. Инструмент подходит для использования в ритейле, банкинге, промышленном производстве, для повышения безопасности в городе и многих других отраслях.
Рассказали что это, как работает и какие пакеты услуг мы предлагаем в новой статье ➡️https://www.spot.uz/ru/2024/02/15/veon-ad-tech/
– – –
We have launched video analytics — a new product for businesses that is changing the approach to security and data analysis. The tool is suitable for use in retail, banking, industrial production, enhancing urban security, and many other industries.
Find out what it is, how it works, and what package deals we offer in our new article ➡️https://kun.uz/en/17284086
#VEONAdTech#innovations#IT#bigdata#videoanalytics
#CVengineer#middle#job#remote#fulltime#videoanalytics
Hi! We’re looking for a skilled and proactive Computer Vision Engineer to join our team and help us develop intelligent video analytics solutions. You’ll work on detecting complex events from video streams, designing robust ML pipelines, and improving internal tools to streamline development.
Location: Remote (you should be based outside Russia and Belarus).
Type: Full-time
Salary: 3500-4500 EUR gross (higher range can be discussed depending on your experience).
✈️ Assaia provides AI-based software solutions for global airports and airlines. We were founded in February 2018 in Switzerland, headquartered in Zurich and New York and we have a fast-growing team located across Europe and North America.
Assaia offers AI-based computer-vision solutions that monitor and analyse aircraft turnaround processes from video streams. Assaia’s solutions help airports and airlines improve on-time performance, efficiency, safety, and sustainability metrics, helping them get their passengers to their destinations on time. We work with aviation companies across the world including New York JFKIAT, Toronto Pearson, United Airlines, British Airways, London Heathrow and more. See details and demos on our website and Linkedin!
🎆We are a fully remote team of 85 and growing.
Responsibilities:
✍️Design and implement pipelines for detecting various types of events in video streams.
🛠Develop and maintain an internal SDK for solving similar computer vision tasks across projects.
♾️Actively participate in brainstorming sessions and technical discussions.
🤝Regularly propose ideas to improve team workflows, reduce tech debt, and make our daily work easier and more effective.
Requirements:
🐍3+ years of hands-on experience with Python.
⏳3+ years of experience in Computer Vision.
🐳 Practical experience with PyTorch and/or TensorFlow.
💪Strong understanding of model training, evaluation, and optimization.
🙂Comfort with daily use of LLM-based tools (e.g., for code generation, debugging, or documentation).
🇬🇧Very good verbal and written English skills (at least B2+).
Nice to have:
➕Experience working with video-based CV tasks (e.g., multi-frame tracking, action recognition, temporal models).
💥Familiarity with deployment pipelines and SDK development for ML/CV.
⬆️Background in working with real-world noisy data.
Assaia is a unique place where you can work on a technically advanced and innovative product for an exciting and important industry. You will be working in a diverse international team of smart people who can learn a lot from each other – all this without leaving your home – or sunbed, if you wish!
Your input will be valuable and we actively ask everyone to share their thoughts and ideas to help steer the direction of the company’s development. Additionally, we offer:
🗺Always remote work and flexible schedule.
😍5 weeks of paid vacation, paid sick leave, paid relevant courses and conferences/online education/English courses.
💜Regular performance reviews to make sure you enjoy your tasks, challenges, growth and salary.
🤝Flat hierarchy and close to zero bureaucracy, a diverse international team of smart people.
🏝Live team events in Europe.
✅Got questions or want to apply? Reach out to @MatveevaKse