needs help in how to translate ≾

Ian Maurer ian_maurer at yahoo.com
Wed Sep 17 16:50:41 EDT 2003


This code accomplishes that goal... but it's not very reusable. At
a minimum you need to put the (non-print) steps in a function.

>>> text = "(('&#8830Hello World&#8830'),(''))"
>>> tupl = eval(text)
>>> print tupl
('&#8830Hello World&#8830', '')
>>> s = tupl[0]
>>> print s
&#8830Hello World&#8830
>>> final = s.replace("&#8830", '"')
>>> print final
"Hello World"
>>>

Good Luck!
Ian Maurer

--- "Raaijmakers, Vincent (IndSys, GE Interlogix)"
<Vincent.Raaijmakers at ge.com> wrote:
> As a newbie in coding in encoding I need some help from the guru
> here.
> When I get information from a user database (mySQL) I get text that
> looks like:
> 
> (('≾Hello World≾'),(''))
> 
> How can I create this info into a string that looks like:
> "Hello World"
> 
> Because what I know is that ≾ stands for the character "
> 
> Must be veeeeerrrrryyyy simple, but how?
> 
> Thanks,
> Vincent
> 
> --
> http://mail.python.org/mailman/listinfo/python-list


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com





More information about the Python-list mailing list