Вы заметили что с интерактивной консолью из прошлого поста что-то не так? Что происходит если нажать стрелки вверх/вниз? Полный бардак!
Давайте поправим это дело!
Для сохранения и загрузки истории будем использовать специальный модуль readline.
Что добавлено?
🔸 Сохранение истории команд с возможностью выбора предыдущих (клавиши ⬆️⬇️ )
🔸 Сохранение истории в файл перед выходом из интерактива для будущих сессий
🔸 Автокомплит по нажатию клавиши TAB
🔸 Cписок вариантов автокомплита по двойному нажатию TAB
Код забираем здесь ↗️
#tricks#source
🌍 Some biodiversity hotspots, like the Cape Floristic Region in South Africa, pack over 9,000 plant species into just a tiny area—nearly 70% found nowhere else on Earth. ✨
#biodiversity⚡#plants⚡#hotspots⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The Sundaland region in Southeast Asia is a biodiversity hotspot where over 15,000 plant species are found, nearly half of which exist nowhere else on Earth. ✨
#biodiversity⚡#hotspots⚡#conservation⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The Western Ghats in India hold more amphibian species than all of Europe, packed into a narrow mountain strip. This biodiversity hotspot shelters ancient frogs found nowhere else on Earth. ✨
#biodiversity⚡#hotspots⚡#amphibians⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 New species are still being discovered in biodiversity hotspots like the Eastern Himalayas, where over 350 new plants and animals have been found in just two decades. ✨
#hotspots⚡#species⚡#discovery⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels