Can't import Tkinter module.
I'm working on linux Fedora Core 3 with Python 2.3. I can't "from Tkinter import *" . And see only "No modlue named Tkiner" error. Of course I have tk/tcl 8.4. They works perfectly. Certainly, I don't have Tkinter module for Python. What should I do for it as I'm not a root? -- http://mail.python.org/mailman/listinfo/python-list
How to read strings cantaining escape character from a file and use it as escape sequences?
How to read strings cantaining escape character from a file and use it
as escape sequences?
for example, a file 'unicodes.txt' has contents:
\u0050\u0079\u0074\u0068\u006f\u006e
Now,
>>> file = open('unicodes.txt')
>>> line = file.readline()
>>> line
'\\u0050\\u0079\\u0074\\u0068\\u006f\\u006e\n'
>>> print line
\u0050\u0079\u0074\u0068\u006f\u006e
But I want to get a string:
"\u0050\u0079\u0074\u0068\u006f\u006e"
How do you make it?
--
http://mail.python.org/mailman/listinfo/python-list
Re: How to read strings cantaining escape character from a file and use it as escape sequences?
WOW! Great! Thanks, Duncan.
On 12월2일, 오전12시33분, Duncan Booth <[EMAIL PROTECTED]> wrote:
> slomo <[EMAIL PROTECTED]> wrote:
> >>>> print line
> > \u0050\u0079\u0074\u0068\u006f\u006e
>
> > But I want to get a string:
>
> > "\u0050\u0079\u0074\u0068\u006f\u006e"
>
> > How do you make it?
>
> line.decode('unicode-escape')
--
http://mail.python.org/mailman/listinfo/python-list
