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,

1

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.