i have a script which should take one parameter from command line. I have a problem to parse a special characters like currency symbols ($, €, £). It is possible to correctly parse these arguments in python. Code looks like:
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--input", type=str, required=True)
args = parser.parse_args()
print args.input
if __name__ == '__main__':
main()
When i run it from cmd on Windows
./myCode --input $
$
it print $ fine. But it is not working for € and £. How can I correctly encode these characters from command line?
./myCode --input £
L
./myCode --input €
UnicodeDecodeError