
Episode 80
Make Your Python App Interactive With a Text User Interface (TUI)
The Real Python Podcast · Real Python
October 1, 20211h 2m
Audio is streamed directly from the publisher (dts.podtrac.com) as published in their RSS feed. Play Podcasts does not host this file. Rights-holders can request removal through the copyright & takedown page.
Show Notes
<p>Have you wanted to create a Python application that goes further than a command-line interface? You would like it to have a friendly interface but don’t want to make a GUI (Graphical User Interface) or web application. Maybe a TUI (Text User Interface)would be a perfect fit for the project. This week on the show, we have Will McGugan to talk about his projects Textual and Rich.</p>
<p>Rich is a Python library for writing rich text to the terminal with color and style. It’s a great tool if you want to display advanced content such as tables, markdown, and syntax-highlighted code. We talk about how Will started on the project and how it’s developed over the years.</p>
<p>We also talk about Will’s new project Textual, a TUI using much of Rich at its core. He shares how the project is coming along and what are challenges in developing this type of application. We discuss how a TUI has more in common with CSS and web development than command line or graphical interfaces.</p>
<p>We also have a quick announcement at the top of the show from CPython Developer in Residence Łukasz Langa about next week’s release of Python 3.10.</p>
<div class="alert alert-primary" role="alert">
<p><strong>Course Spotlight:</strong> <a href="https://realpython.com/courses/python-rock-paper-scissors-game/">Rock, Paper, Scissors With Python: A Command Line Game</a></p>
<p>In this course, you’ll learn to program rock paper scissors in Python from scratch. You’ll learn how to take in user input, make the computer choose a random action, determine a winner, and split your code into functions. </p>
</div>
<p>Topics:</p>
<ul>
<li>00:00:00 – Introduction</li>
<li>00:02:08 – Python 3.10 Release Party - Announcement</li>
<li>00:03:32 – Will McGugan and the background of the Rich library</li>
<li>00:10:11 – Moya framework</li>
<li>00:21:38 – Sponsor: DataStax Astra DB</li>
<li>00:22:10 – The spark that started Textual</li>
<li>00:26:31 – Needing AsyncIO for a TUI</li>
<li>00:28:07 – Describing a TUI (Text User Interface)</li>
<li>00:33:57 – Scrolling, resizing, and similarities with CSS</li>
<li>00:36:37 – Video Course Spotlight</li>
<li>00:38:03 – What areas were difficult in developing Textual?</li>
<li>00:39:42 – Similarities to game development</li>
<li>00:41:47 – Testing across different terminals</li>
<li>00:45:01 – What were you excited to include in the project?</li>
<li>00:47:04 – Are there particular uses you foresee for Textual?</li>
<li>00:49:21 – Career changes and open source reviewing</li>
<li>00:54:21 – Version numbers and Textual</li>
<li>00:55:49 – What are you excited about in the world of Python?</li>
<li>00:58:27 – What do you want to learn next?</li>
<li>01:00:57 – Shoutouts and plugs</li>
<li>01:01:47 – Thanks and goodbye</li>
</ul>
<p>Show Links</p>
<ul>
<li><a href="https://www.willmcgugan.com">Will McGugan’s Blog</a></li>
<li><a href="https://github.com/willmcgugan">Will McGugan’s GitHub</a></li>
<li><a href="https://rich.readthedocs.io/en/stable/">Rich Documentation</a></li>
<li><a href="https://realpython.com/python-rich-package/">The Python Rich Package: Unleash the Power of Console Text</a></li>
<li><a href="https://pygments.org/">Pygments: Python Syntax Highlighter</a></li>
<li><a href="https://docs.python.org/3/reference/datamodel.html?highlight=repr#object.__repr__"><code>object.__repr__ (self)</code>: Python docs</a></li>
<li><a href="https://realpython.com/regex-python/">Regular Expressions: Regexes in Python (Part 1) - Real Python</a></li>
<li><a href="https://www.moyaproject.com">Moya: Open source web development platform built with Python</a></li>
<li><a href="https://www.willmcgugan.com/blog/tech/post/building-rich-terminal-dashboards/">Building Rich terminal dashboards: Will’s blog</a></li>
<li><a href="https://github.com/willmcgugan/textual">Textual: A TUI (Text User Interface) framework for Python inspired by modern web development</a></li>
<li><a href="https://pyfound.blogspot.com/2021/05/the-2021-python-language-summit-making.html">The 2021 Python Language Summit: Making CPython Faster</a></li>
<li><a href="https://realpython.com/podcasts/rpp/">Episode 69: Planning a Faster Future at the Python Language Summit</a></li>
<li><a href="https://twitter.com/pyblogsal/status/1442890650303664131">Python 3.10 Release Party Announcement</a></li>
<li><a href="https://twitter.com/llanga">Łukasz Langa’s twitter: Developer in Residence</a></li>
<li><a href="https://twitter.com/pyblogsal">Pablo Galindo Salgado’s twitter: Python 3.10 and 3.11 release manager</a></li>
<li><a href="https://twitter.com/willmcgugan">Will McGugan’s Twitter</a></li>
<li><a href="https://www.willmcgugan.com/blog/tech/post/doing-open-source-full-time/">Why I’m working on Open Source full time</a></li>
</ul>
<p>Level up your Python skills with our expert-led courses:</p>
<ul>
<li><a href="https://realpython.com/courses/intermediate-project-ideas/">Grow Your Python Portfolio With 13 Intermediate Project Ideas</a></li>
<li><a href="https://realpython.com/courses/command-line-interfaces/">Command Line Interfaces in Python</a></li>
<li><a href="https://realpython.com/courses/python-rock-paper-scissors-game/">Rock, Paper, Scissors With Python: A Command Line Game</a></li>
</ul> <p><a rel="payment" href="https://realpython.com/join">Support the podcast & join our community of Pythonistas</a></p>