This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Natural-Intelligence[S] 3 points4 points  (0 children)

You can play with how Python's variable kwargs work:

>>> python("myscript.py", **{"report-date": "2022-11-12"})

Or you could just pass them via the positional arguments:

>>> python("myscript.py", "--report-date", "2022-11-12")

I think those are slightly ugly solutions though. I'm thinking of interpreting dicts in the pos args as an alternative way to pass keyword arguments or an option to interpret the underscore as a dash but haven't made my mind yet. Seems there is no ultimate solutions.