TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #208 · 29 јан.

Ранее мы уже говорили о том, как выполнить какой-либо код перед открытием интерактивной консоли. Расскажу еще один способ! На самом деле, даже запустив интерпретатор в обычном режиме с выполнением скрипта из файла вы можете в любом месте активировать интерактивный режим. Или даже несколько по очереди. За это отвечает модуль 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

Резултати

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

Пребарај: #shamino

当前筛选 #shamino清除筛选
DruschbaFM - English

@druschbaFm_en · Post #51966 · 12.03.2025 г., 08:02

⚡️🇷🇺🇺🇦⚡️ Two Majors #Summary for the Morning of 12 March 2025; 06:27 (GMT+3)⚡️ 🔹 The Russian Army continues its #Kursk offensive with decisive objectives. Yesterday, #KazachyaLoknya, #Zamostye, #Makhnovka, #Mirny, #Bondarevka, #Dmitryukov, and #Knyazhy1st and #Knyazhy2nd hamlets were liberated. Russian forces are advancing from #Sudzha’s industrial zone and central market, with reports of movement in the built-up areas. Footage has emerged of Ukrainian infantry retreating westward. Russian troops are also active in the #Sumy region near #Zhuravka. The #Sudzha – #Yunakovka Motorway is under Russian fire control, and AFU reinforcements attempting to enter the #Kursk region have been repelled. Heavy battles for the region’s liberation continue. 🎯 Russian Forces struck targets in #Odessa region overnight, with the enemy claiming a 'cargo ship carrying grain' was damaged. Confirmed strikes hit infrastructure in #Dnepropetrovsk, with explosions reported in #Kiev, #Pavlograd, #Kramatorsk, #SnakeIsland, as well as in the #Cherkassy, #Kharkov, #Sumy, and #Khmelnitsky regions. 🛡 Russian Air Defences repelled a night-time attack on the #Bryansk region. 🔹 In #Seversk Sector, Russian forces continue difficult advances west of #Belogorovka, facing fierce and organised 👉resistance. 🔹 In #Toretsk, reports persist of AFU units being deployed deeper into urban areas. 🔹 In #Pokrovsk Direction, clashes continue in #Shevchenko, #Peschanoye, #Kotlino, and #Uspenovka. On the far right flank, east of #Pokrovsk, Russian forces are attacking near #Tarasovka. 🔹 On the #Vremyevka Ledge, north of #VelikayaNovosyolka, the 'East Group of Troops' has secured #Dneprenergiya. The enemy claims successful counterattacks in #Novosyolka. 🔹 On the #Zaporozhye Front, Russian forces raised the flag over #Pyatikhatki after prolonged heavy battles.🎬👆The village, situated in a low-lying area, has been in ruins since summer 2023 and lacks underground shelters, making long term consolidation uncertain. 💥 In #Belgorod Region, the AFU continues to target civilians. In Shebekino district, a UAV attack damaged equipment at a commercial facility in #Dobroye. In #Shamino, an FPV drone struck a civilian car. Another drone hit a private residence in #NizhneyeBeryozovo2nd. In Grayvoron district, a UAV detonation in a private residence in #Glotovo caused an attic fire. In #Valuyki, an FPV drone damaged a car and shattered windows. In #Shelayevo, a drone exploded on the ground. 💥 In the #DPR, a 2001-born woman was injured in #Gorlovka following a Nazi artillery strike, with further damage to civilian infrastructure. In #KrasnayaPolyana, Volnovakha district, a 1966-born man sustained injuries from an explosive device detonation. 💬Welcome to Military Chat; 🇬🇧Battle Maps 📱 Join GLOBAL DEPTH to boost your TG Feed GLOBAL DEPTH from #HK This channel aims to unite interested individuals from around the world in an attempt to connect the dots. Subscriber participation is always welcome here and in the channel's Chat Group.