Arguments are not working with 'textual run'
See original GitHub issuePer textual run --help
:
If you are running a file and want to pass command line arguments, wrap the
filename and arguments in quotes:
textual run "foo.py arg --option"
This is not working. Using the following sample.py:
from textual.app import App, ComposeResult
from textual.widgets import Static
from sys import argv
class MyApp(App):
def __init__(self, greeting: str="default") -> None:
self.greeting = greeting
super().__init__()
def compose(self) -> ComposeResult:
yield Static(f"{self.greeting}")
if __name__ == "__main__":
if len(argv) > 1:
app = MyApp(argv[1])
else:
app = MyApp()
app.run()
When run via:
python ./sample.py foo
it returns a textual window with foo
When run via:
textual run "./sample.py foo"
it returns a textual window with default
Issue Analytics
- State:
- Created a year ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Eclipse: Running with argument and not finding text file
But Eclipse is telling me this error message. I am not sure why Eclipse cannot open the file.
Read more >Adding arguments and options to your Bash scripts - Red Hat
Look at your $PATH variable, which contains /home/username/bin as one component. If the ~/bin directory does not exist, you can create it. Or ......
Read more >Python Command Line Arguments
A command line interface (CLI) provides a way for a user to interact with a program running in a text-based shell interpreter.
Read more >Command Line Arguments for Your Python Script
This tutorial is in three parts; they are: Running a Python script in command line; Working on the command line; Alternative to command...
Read more >Sending arguments to LAStools function from Python script not ...
I suppose this has to do with the '' around the string, but every other executable file I have called from python in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jspv Yup, as Will mentions, about 90 minutes before you mentioned it, we did https://github.com/Textualize/textual/pull/1070 which should address this. 😃
There’s a fix for this in master.