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,453 слични објави

Пребарај: #linux

当前筛选 #linux清除筛选
2.5次元日常 🍉

@acgndaily · Post #49966 · 02.04.2026 г., 19:43

Steam 用户中使用 Linux 比例达到 5.33% 2026-04-02 12:57 by 头号书迷 Valve 公布的 2026 年 3 月 Steam 硬件和软件调查显示,玩家运行的操作系统中 Linux 比例达到了 5.33%。和 2026 年 2 月的情况类似,Valve 的统计数据可能再次出现异常,因为 2 月 Linux 的比例仅为 2.23%,一个内月突然翻一倍以上概率不大。Windows 操作系统的比例降至了 92.33%,OSX 占 2.35%。Linux 用户比例此前从未超过 5%,超过 3% 也仅为一次。今年 2 月 Steam 简体中文用户比例数据异常,超过了五成,3 月 Valve 看起来修正了错误,简体中文用户比例减少 31.85% 占 22.75%,英语用户增加 16.82% 占 39.09%。用户使用英特尔 CPU 的比例占 55.82%。AMD 占 44.17%。 store.steampowered.com/hwsurvey/ #Linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18794 · 14.05.2026 г., 17:36

📰 MSI Claw Configuration Driver For Linux Coming Together With The Assistance Of AI One of the latest Linux gaming handheld drivers being worked on is the MSI Claw Configuration Driver for controller configuration... 🔗 Source: https://www.phoronix.com/news/MSI-Claw-Configuration-Driver #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18779 · 13.05.2026 г., 18:13

📰Rust stalks IBM mainframes, but only in nightly form Patch series would bring memory-safe code to Linux's s390 port, with compiler caveats attached. 🔗 Source: https://www.theregister.com/on-prem/2026/05/13/rust-stalks-ibm-mainframes-but-only-in-nightly-form/5239710 #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18774 · 13.05.2026 г., 12:46

📰 Linux gains more critical Windows apps: 3D Movie Maker and Space Cadet Pinball Further demonstrating its role as industry default OS the versatility of modern porting tools. 🔗 Source: https://www.theregister.com/oses/2026/05/13/linux-gains-more-critical-windows-apps-3d-movie-maker-and-space-cadet-pinball/5239455 #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18770 · 13.05.2026 г., 08:37

📰Discord joke that it's The Year of the Linux Desktop The Year of the Linux Desktop is finally here! Sort of. Well, not really but it's getting there and Discord has seen some nice improvements lately.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/05/discord-joke-that-its-the-year-of-the-linux-desktop/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18758 · 12.05.2026 г., 14:15

📰 Fwupd 2.1.3 Linux Firmware Updater Adds Support for SHIFT6mq and SHIFTphone 8 Fwupd 2.1.3 Linux firmware updater is now available for download with support for the SHIFT6mq and SHIFTphone 8 modular smartphones, as well as various other improvements. 🔗 Source: https://9to5linux.com/fwupd-2-1-3-linux-firmware-updater-adds-support-for-shift6mq-and-shiftphone-8 #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18752 · 11.05.2026 г., 21:59

📰 I tested every Linux desktop and realized fragmentation isn't a problem anymore Choosing a Linux desktop used to be a make-or-break decision, but nowadays, things are much less complicated. 🔗 Source: https://www.xda-developers.com/tested-every-linux-desktop-realized-fragmentation-problem-anymore/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18746 · 11.05.2026 г., 13:18

📰 F2FS Preparing FSERROR Reporting Support Introduced in Linux 7.0 was FSERROR as generic I/O error reporting infrastructure. Linux to that point had no standardized mechanism for reporting metadata corruption or file I/O errors to user-space with each file-system doing its own thing. The Flash-Friendly File-System (F2FS) is now the latest Linux file-system preparing for FSERROR usage... 🔗 Source: https://www.phoronix.com/news/F2FS-FSERROR #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18744 · 11.05.2026 г., 11:26

📰 Linux 7.0.6 Released To Finish Mitigating the Dirty Frag Vulnerability Linux 7.0.6 is out as stable this morning to finish mitigating the Dirty Frag vulnerability that was made public last week... 🔗 Source: https://www.phoronix.com/news/Linux-7.0.6-Released #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18742 · 11.05.2026 г., 09:40

📰 PeaZip 11.1 File Archiver Adds Security Fixes and Updates 7z Backend PeaZip 11.1 updates its 7z backend, fixes security issues, and improves archive extraction workflows across Linux and Windows. 🔗 Source: https://linuxiac.com/peazip-11-1-file-archiver-adds-security-fixes-and-updates-7z-backend/ #linux

Hashtags

123•••100•••121122
ПретходнаСтраница 1 од 122Следна