Вы заметили что с интерактивной консолью из прошлого поста что-то не так? Что происходит если нажать стрелки вверх/вниз? Полный бардак!
Давайте поправим это дело!
Для сохранения и загрузки истории будем использовать специальный модуль readline.
Что добавлено?
🔸 Сохранение истории команд с возможностью выбора предыдущих (клавиши ⬆️⬇️ )
🔸 Сохранение истории в файл перед выходом из интерактива для будущих сессий
🔸 Автокомплит по нажатию клавиши TAB
🔸 Cписок вариантов автокомплита по двойному нажатию TAB
Код забираем здесь ↗️
#tricks#source
🌎 In the world’s caves, “moonmilk” forms as a creamy white mineral paste, oozing from rock walls. Created by bacteria that slowly dissolve limestone, moonmilk has been used for centuries as folk medicine by local cultures. ✨
#geology⚡#microbiology⚡#caves
👉subscribe Interesting Planet
🌍 Some karst caves contain rare bacteria that feed on mineral rock, creating colorful biofilms and even helping form new cave crystals—making the underground world alive in ways few people expect. ✨
#caves⚡#karst⚡#microbiology⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Some polar lakes never see sunlight and stay covered with ice year-round. Microbes living under this ice survive in complete darkness, making them some of the most isolated life forms on Earth. ✨
#glaciers⚡#polar⚡#microbiology⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌎 In the dry canyons of the American Southwest, cryptobiotic soil forms a living crust of bacteria, fungi, and lichens. This fragile layer stabilizes desert soil and helps seeds germinate, supporting entire ecosystems in these harsh climates. ✨
#desert⚡#microbiology⚡#ecosystems
👉subscribe Interesting Planet