I want to use reserved keyword "from" as the name of variable.
I have it in my arguments parser:
parser.add_argument("--from")
args = parser.parse_args()
print(args.from)
but this isn't working because "from" is reserved. It is important to have this variable name, I don't want answers like "from_".
Is there any option?
from_, but you'd have an easier time of reading your code without the work-arounds that requires.from_as the variable name. Similar to this answers you can modify the Python source (the source code of the compiler) in order to change the reserved keywordfromto something else (for examplefrom_). Then you can rebuild the source in order to obtain your custom Python compiler with which you can usefromas a variable name. Please note that this is a horrible idea for many reasons.