How to convert ArgumentParser code to Mojo? #1029
Replies: 3 comments
-
extactly same exception :( |
Beta Was this translation helpful? Give feedback.
-
from python import Python
fn main() raises:
let argparse = Python.import_module("argparse")
let parser = argparse.ArgumentParser()
parser.description = "your description here"
let example_arg = parser.add_argument("-d", "--database")
example_arg.require = True
example_arg.help = "help text"
print(parser)
print(example_arg) the output is
but if i append following code there is exception:
execution with:
then i changed the the problem could be: how to set required var through a command line |
Beta Was this translation helpful? Give feedback.
-
Unknown declaration
|
Beta Was this translation helpful? Give feedback.
-
I am trying to convert code like this to Mojo
and what I did
and I got
Beta Was this translation helpful? Give feedback.
All reactions