Open zvr opened 4 years ago
@zvr pls check the -f/-t use, I've just added in.
also, I need an advice..
How to use from
as an argument in a function because it is predefined in python.
in the code, I need to replace frome
to from
also, I need an advice.. How to use from as an argument in a function because it is predefined in python. in the code, I need to replace frome to from
@pombredanne - as a Python Person - could you help out Yash on his question related to reserved words?
also, I need an advice.. How to use
from
as an argument in a function because it is predefined in python. in the code, I need to replacefrome
tofrom
@Yash-Varshney can you elaborate with specifics and either a code snippet or a link?
Note that you cannot use keyword reserved names except as keywords. That's an axiom :) ... so no from and no for, if else, etc.
@pombredanne the code snippet was something like this:
@click.option("--frome", "-f", type=click.Choice(["tag", "rdf"], case_sensitive=False))
def main(infile, outfile, src, frome, to):
I am using click
module but was not able to use the term from
.
Thanks for helping and pointing out the axiom 👍
-f
and -t
--fromfmt
and --tofmt
(and therefore the args in the function)click.option
also have a default="undefined"
so that you can check when determining formatsActually I just checked and the click
documentation has exactly the way to use --from
in the option
manual, under the comment
How to use a Python reserved word such as
from
as a parameter
thanks @zvr. I think the motive of this issue is achieved, please look out the code.
besides automatic format discovery based on filename extensions, the user should be able to specify in and out formats with command-line options
t
,--to=
,-f
,--from
This would allow to call it like:
Refer to my previous email for more invocation examples.