Revision history [back]
Running Textual Apps in a specific Terminal
Hi,
Is there a way to specify to run a Python script in a separate terminal application, such as iTerm2 on Mac or Windows Terminal on Windows?
I am developing multiple applications in the Textual package (https://textual.textualize.io/) and you can't run them in the Wingware IDE. Technically, the code runs, but you won't see the actual TUI at all. Instead, you get control and junk characters in the Debug I/O tab.
Here's an example piece of code:
import rich.spinner
from textual.app import App, ComposeResult
from textual.widgets import Static
class WidgetSpinner(Static):
def on_mount(self):
self.spinner = rich.spinner.Spinner("dots", text="working...")
self.interval_update = self.set_interval(
1 / 60, lambda: self.update(self.spinner)
)
class ExampleApp(App):
def compose(self) -> ComposeResult:
yield WidgetSpinner()
if __name__ == "__main__":
ExampleApp().run()
If you run this in a terminal yourself, you will see a spinner. If you run it in Wing, you don't get the output, which is kind of what I expected, but I don't know how to launch it in a process properly.
If you could give me some pointers, that would be great.
Thanks!