I'm having a problem using sys.argv[] to pass some values to a Python script.
My Python script is like that:
#Obtención de los valores provenientes del servidor
referencia = sys.argv[1] #referencia velocidad
referencia = int(referencia)
In the lx terminal I execute the next command:
$sudo python referencia.py 2750
And the terminal gives me the next error:
File "referencia.py", line 11
SyntaxError: Non-ASCII character '\xc3' in file referencia.py on line 11, but no encoding declared: see http://python.org/dev/peps/pep-0263/ for details
Has anyone one solution to execute my script without errors?
Thanks,
-
stackoverflow.com/questions/6289474/… It's not the input, but the source code (ó)BGabor– BGabor2018年01月10日 16:38:08 +00:00Commented Jan 10, 2018 at 16:38
1 Answer 1
It complains about the "ó" in "Obtención" in the comment, try to avoid using "special characters" in your files or specify the encoding you're using. See https://www.python.org/dev/peps/pep-0263/ for documentation.
answered Jan 10, 2018 at 16:39
Lohmar ASHAR
1,77114 silver badges20 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-py