As Python 3k introduces strict distinction between strings and bytes, command line arguments in the array sys.argv are presented as strings. Sometimes it is necessary to tre
You can do:
sys.argv[1].encode() or, if you know the encoding use it as argument or call bytes(sys.argv[1], 'latin-1').
sys.argv[1].encode()
bytes(sys.argv[1], 'latin-1')
Both should give you a byte representation of the unicode string.
By default, Python3 uses UTF-8.