parsing non-ascii characters

R

Ronn

Hello all,

I have a list:
suffix = ["aĉ", "ad", "aĵ", "an", "ar"]

and I'm trying to check a word to see if any of the suffixes exist in
the list for example:
if word in suffix:
print "A suffix exist in your word"

when I run this it give me an error:
SyntaxError: Non-ASCII character '\xc5' in file vortaro.py on line
33, but no encoding declared;

is there a way to parse Non-ASCII characters in python?

Thanks in advance,
Ronn
 
J

John Machin

Hello all,

I have a list:
  suffix = ["aĉ", "ad", "aĵ", "an", "ar"]

and I'm trying to check a word to see if any of the suffixes exist in
the list for example:
  if word in suffix:
      print "A suffix exist in your word"

when I run this it give me an error:
   SyntaxError: Non-ASCII character '\xc5' in file vortaro.py on line
33, but no encoding declared;

Read this:
http://docs.python.org/tutorial/interpreter.html#source-code-encoding

Read all of the tutorial.
is there a way to parse Non-ASCII characters in python?

This question is meaningless.
 
Ò

Ò»Ê×Ê«

Hello all,

I have a list:
  suffix = ["aĉ", "ad", "aĵ", "an", "ar"]

and I'm trying to check a word to see if any of the suffixes exist in
the list for example:
  if word in suffix:
      print "A suffix exist in your word"

when I run this it give me an error:
   SyntaxError: Non-ASCII character '\xc5' in file vortaro.py on line
33, but no encoding declared;

is there a way to parse Non-ASCII characters in python?

Thanks in advance,
Ronn

http://www.python.org/dev/peps/pep-0263/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top