Ранее мы уже говорили о том, как выполнить какой-либо код перед открытием интерактивной консоли.
Расскажу еще один способ! На самом деле, даже запустив интерпретатор в обычном режиме с выполнением скрипта из файла вы можете в любом месте активировать интерактивный режим. Или даже несколько по очереди. За это отвечает модуль 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
#Jizzakh#Green_School
🌿 Under the Public Association “Ekolog” of Uzbekistan, the “Green School Council” of Jizzakh region organized an environmentally significant
💚 Plogging activity (picking up litter while walking or running). Coordinators and members of the council took part in the event.
📍 During the campaign, Sharof Rashidov main street and surrounding areas were cleaned of waste. Such environmental initiatives not only improve the urban environment but also play an important role in raising ecological responsibility among young people.
🔍 The main goal of the event was to increase environmental awareness among the population and to promote a sustainable lifestyle, as well as a more conscious attitude toward a clean and green environment among youth.
☘️Read the latest environmental news on the @ekologuz page. Follow us and send your suggestions and wishes via @eklguz_bot
Instagram | Facebook | Twitter | Sayt | Youtube.
🚀3 Startups Funded at “Investor Day” in Jizzakh
Jizzakh hosted “Investor Day” — a platform for startups from Jizzakh, Tashkent, and Syrdarya regions to pitch their ideas directly to investors.
💡 A total of 11startups presented their projects in front of leading investors, including: AloqaVentures, IT Park Ventures, Startup Garage, Sarmo Ventures, and independent business angels.
🤝 The B2B meeting format also allowed participants to receive practical feedback from top experts:
• Shahzod Narzullayev (IT Park Ventures)
• Davron Parmonov (AloqaVentures)
• Muhammad Khalil (Startup Garage)
• Abdul Sharafiy (Sarmo Labs)
📈 Over 700 young participants attended the event — for many, it became a powerful source of inspiration.
🏆 Investment deals from AloqaVentures:
• Maqsaddosh — $20,000
• Medmap — $20,000
• Mom+ — $20,000
Such regional events play a key role in building the innovation ecosystem and connecting local founders with active investors.
#StartupUzbekistan#InvestorDay#Jizzakh#VentureFunding#TechEcosystem
⚠️ ECOLOGICAL VIOLATIONS ARE BEING IGNORED!
As of January 25, 2026, the activities of LLC “Ko‘mir Ta’minoti” of Jizzakh region, particularly the Dashtabod coal storage facility, continue to cause direct harm to local residents, while grossly violating environmental and sanitary regulations.
Unfortunately, this company continues to operate without complying with basic environmental standards. Coal dust, air pollution, and the absence of protective measures have become a daily problem for the surrounding community.
These violations have been reported several times on our Telegram channel.
📌 Most concerning is the fact that:
Since December 2025, residents and public representatives have repeatedly submitted official complaints to the responsible authorities, yet:
— no effective action has been taken,
— no fines have been imposed,
— no official explanations have been provided to the public.
❗️ This raises serious questions:
Why are environmental violations going unpunished?
Why is public health being ignored?
We, as citizens and representatives of civil society, demand an urgent review of this situation and request written, official information regarding:
— the identified violations,
— the measures taken in response,
— the fines imposed (or not imposed) on this enterprise.
🟢 Environmental protection is not a formality.
🟢 It is a matter of human health, children’s future, and the right to a clean environment.
Responsible authorities must not remain silent.
The public will continue to closely monitor this case.
#Ecology
#EnvironmentalViolations
#Dashtabod
#Jizzakh
#PublicHealth
#PublicOversight☘️Read the latest environmental news on the @ekologuz page. Follow us and send your suggestions and wishes via @eklguz_bot
Instagram | Facebook | Twitter | Sayt | Youtube.
🇺🇿🚀 BMB AGRO PLUS: ғоядан — экспортгача!
Эсингизда бўлса, яқиндагина Жиззахда BMB Agro Plus — инновацион корҳонамизнинг очилиши бўлиб ўтган эди. Ушбу лойиҳа маҳсулотни шок ва акустик музлатиш технологияси асосида чуқур қайта ишлаш учун яратилган.
📦 Бугун лойиҳа амалий босқичга ўтмоқда:
илк юқори технологияли музлатилган маҳсулот партияси Европага экспорт қилинди!
☝Бу — BMB Holding стратегиясининг амалдаги ифодаси: етиштириш, қайта ишлаш ва экспорт қилиш.
🇺🇿Ўзбек даласидан — 🇪🇺Европа супермаркетларининг расталаригача!
Ва бу — фақатгина бошланиши.
🔹 BMB Holding — келажак сари дадил одимламоқда!
#BMBHolding#BMBAgroPlus#Jizzakh#MadeInUzbekistan#UzAgroExport#АгроЭкспорт#Инновации#ШоковаяЗаморозка#AgroTech#ExportReady#AgroFuture#УзбекистанЕвропа#BMBданЕвропага
@bahodir_schastlivchik