Re: Python & unicode

P_at_draigBrady.com
Date: 01/11/05


Date: Tue, 11 Jan 2005 10:21:16 +0000

Michel Claveau - abstraction méta-galactique non triviale en fuite
perpétuelle. wrote:
> Hi !
>
> If Python is Ok with Unicode, why the next script not run ?
>
> # -*- coding: utf-8 -*-
>
> def режим(toto):
> return(toto*3)

Because the coding is only supported in string literals.
But I'm not sure exactly why. It would be nice to do:

import math
Ï€ = math.pi

-- 
Pádraig Brady - http://www.pixelbeat.org
--


Relevant Pages

  • unicode string literals and "u" prefix
    ... In my python scripts, I use a lot of accented characters as I work in ... Then, when I need to store accented characters in a string, I used to ... prefixing a unicode string literal with 'u' ... So, to write "clean" script code, is it a good idea to write a script ...
    (comp.lang.python)
  • Re: Translating Javascript programs to python.
    ... output from the script also would be OK. ... these javascript functions with python. ... program and have it pipe back the telegu unicode version. ... semi-automatically translate the code into python. ...
    (comp.lang.python)
  • Re: Translating Javascript programs to python.
    ... output from the script also would be OK. ... these javascript functions with python. ... program and have it pipe back the telegu unicode version. ... This appears to be based on a generic Indian-script transliteration program ...
    (comp.lang.python)
  • Re: perl to python
    ... sed and perl can let you do all that quick command line stuff. ... into a full blown script. ... scripts, call it from the python interpreter, whatever I need. ... If I stick to the traditional unix approach, ...
    (comp.lang.python)
  • Re: Learning Tkinter
    ... and how the command option is used to call the function callback. ... gui programming to see if the python programs I have written can be made ... search their computer for this file, execute the python code and then ... This is the meaning of the test on __name__: this magical variable is set to the string '__main__' if and only if the current script is the top-most one, i.e the one you ran python on. ...
    (comp.lang.python)