0

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,

Oskar
  • 1
  • 1
  • https://stackoverflow.com/questions/6289474/working-with-utf-8-encoding-in-python-source It's not the input, but the source code (ó) – BGabor Jan 10 '18 at 16:38

1 Answers1

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.

Lohmar ASHAR
  • 1,639
  • 14
  • 18