Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Dr. Dobb's Python-URL! - weekly Python news and links (Dec 30)

Reply
Thread Tools

Dr. Dobb's Python-URL! - weekly Python news and links (Dec 30)

 
 
Cameron Laird
Guest
Posts: n/a
 
      12-30-2004
QOTW: "I found the discussion of unicode, in any python book I have,
insufficient." -- Thomas Heller

"If you develop on a Mac, ... Objective-C could come in handy. . . .
PyObjC makes mixing the two languages dead easy and more convenient than
indoor plumbing." -- Robert Kern


Among other activities, the PSF aggregates donors with dollars
destined to do good Python works, and developers expert in
obscure corners of Pythonia.
http://groups-beta.google.com/group/...5bfe05419aa0b3
http://groups-beta.google.com/group/...22f3e14752ce5/

Yippee! The martellibot promises to explain Unicode for Pythoneers.
http://groups-beta.google.com/group/...15a5a05c206712

The glorious SciPy project supports *multiple* worthwhile Wikis.
http://www.scipy.org/wikis

Good style in Python does not generally include "in-place"
operations on lists. Several cleaner idioms are possible.
http://groups-beta.google.com/group/...4559f53d25474e

Assume you're comfortable with tuples' semantics, immutability,
and so on. Do you correctly understand the basics of their
syntax, though? This is another opportunity to think about
Unicode, by the way.
http://groups-beta.google.com/group/...0049d7adb1bcce

Robert Kern, Paul Rubin, Mike Meyer, Alex Martelli, and others
provide disproportionately high-quality advice (and tangents!)
on the subject of languages which complement Python.
http://groups-beta.google.com/group/...c1c6d9d87049b6


================================================== ======================
Everything Python-related you want is probably one or two clicks away in
these pages:

Python.org's Python Language Website is the traditional
center of Pythonia
http://www.python.org
Notice especially the master FAQ
http://www.python.org/doc/FAQ.html

PythonWare complements the digest you're reading with the
marvelous daily python url
http://www.pythonware.com/daily
Mygale is a news-gathering webcrawler that specializes in (new)
World-Wide Web articles related to Python.
http://www.awaretek.com/nowak/mygale.html
While cosmetically similar, Mygale and the Daily Python-URL
are utterly different in their technologies and generally in
their results.

comp.lang.python.announce announces new Python software. Be
sure to scan this newsgroup weekly.
http://groups.google.com/groups?oi=d...ython.announce

Brett Cannon continues the marvelous tradition established by
Andrew Kuchling and Michael Hudson of intelligently summarizing
action on the python-dev mailing list once every other week.
http://www.python.org/dev/summary/

The Python Package Index catalogues packages.
http://www.python.org/pypi/

The somewhat older Vaults of Parnassus ambitiously collects references
to all sorts of Python resources.
http://www.vex.net/~x/parnassus/

Much of Python's real work takes place on Special-Interest Group
mailing lists
http://www.python.org/sigs/

The Python Business Forum "further[s] the interests of companies
that base their business on ... Python."
http://www.python-in-business.org

Python Success Stories--from air-traffic control to on-line
match-making--can inspire you or decision-makers to whom you're
subject with a vision of what the language makes practical.
http://www.pythonology.com/success

The Python Software Foundation (PSF) has replaced the Python
Consortium as an independent nexus of activity. It has official
responsibility for Python's development and maintenance.
http://www.python.org/psf/
Among the ways you can support PSF is with a donation.
http://www.python.org/psf/donate.html

Kurt B. Kaiser publishes a weekly report on faults and patches.
http://www.google.com/groups?as_usub...python%20patch

Cetus collects Python hyperlinks.
http://www.cetus-links.org/oo_python.html

Python FAQTS
http://python.faqts.com/

The Cookbook is a collaborative effort to capture useful and
interesting recipes.
http://aspn.activestate.com/ASPN/Cookbook/Python

Among several Python-oriented RSS/RDF feeds available are
http://www.python.org/channews.rdf
http://bootleg-rss.g-blog.net/pythonware_com_daily.pcgi
http://python.de/backend.php
For more, see
http://www.syndic8.com/feedlist.php?...ShowStatus=all
The old Python "To-Do List" now lives principally in a
SourceForge reincarnation.
http://sourceforge.net/tracker/?atid...70&func=browse
http://python.sourceforge.net/peps/pep-0042.html

The online Python Journal is posted at pythonjournal.cognizor.com.
and
welcome submission of material that helps people's understanding
of Python use, and offer Web presentation of your work.

deli.cio.us presents an intriguing approach to reference commentary.
It already aggregates quite a bit of Python intelligence.
http://del.icio.us/tag/python

*Py: the Journal of the Python Language*
http://www.pyzine.com

Archive probing tricks of the trade:
http://groups.google.com/groups?oi=d...python&num=100
http://groups.google.com/groups?meta....lang.python.*

Previous - (U)se the (R)esource, (L)uke! - messages are listed here:
http://www.ddj.com/topics/pythonurl/
http://purl.org/thecliff/python/url.html (dormant)
or
http://groups.google.com/groups?oi=djq&as_q=+Python-URL!&as_ugroup=comp.lang.python


Suggestions/corrections for next week's posting are always welcome.
E-mail to <Python-> should get through.

To receive a new issue of this posting in e-mail each Monday morning
(approximately), ask <> to subscribe. Mention
"Python-URL!".


-- The Python-URL! Team--

Dr. Dobb's Journal (http://www.ddj.com) is pleased to participate in and
sponsor the "Python-URL!" project.


 
Reply With Quote
 
 
 
 
Alex Martelli
Guest
Posts: n/a
 
      12-31-2004
Cameron Laird <python-> wrote:
...
> Yippee! The martellibot promises to explain Unicode for Pythoneers.
> http://groups-beta.google.com/group/...15a5a05c206712


Uh -- _did_ I? Eeep... I guess I did... mostly, I was pointing to
Holger Krekel's very nice recipe (not sure he posted it to the site as
well as submitting it for the printed edition, but, lobby _HIM_ about
that.


Alex
 
Reply With Quote
 
 
 
 
holger krekel
Guest
Posts: n/a
 
      01-04-2005
On Fri, Dec 31, 2004 at 19:18 +0100, Alex Martelli wrote:
> Cameron Laird <python-> wrote:
> ...
> > Yippee! The martellibot promises to explain Unicode for Pythoneers.
> > http://groups-beta.google.com/group/...15a5a05c206712

>
> Uh -- _did_ I? Eeep... I guess I did... mostly, I was pointing to
> Holger Krekel's very nice recipe (not sure he posted it to the site as
> well as submitting it for the printed edition, but, lobby _HIM_ about
> that.


FWIW, i added the recipe back to the online cookbook. It's not perfectly
formatted but still useful, i hope.

http://aspn.activestate.com/ASPN/Coo.../Recipe/361742

cheers,

holger

P.S: happy new year.
 
Reply With Quote
 
michele.simionato@gmail.com
Guest
Posts: n/a
 
      01-04-2005
Holger:

> FWIW, i added the recipe back to the online cookbook. It's not

perfectly
> formatted but still useful, i hope.


> http://aspn.activestate.com/ASPN/Coo.../Recipe/361742


Uhm... on my system I get:

>>> german_ae = unicode('\xc3\xa4', 'utf8')
>>> print german_ae # dunno if it will appear right on Google groups

ä

>>> german_ae.decode('latin1')

Traceback (most recent call last):
File "<stdin>", line 1, in ?
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in
position 0: ordinal not in range(12
?? What's wrong?

Michele Simionato

 
Reply With Quote
 
Stephan Diehl
Guest
Posts: n/a
 
      01-04-2005
On Tue, 04 Jan 2005 05:43:32 -0800, michele.simionato wrote:

> Holger:
>
>> FWIW, i added the recipe back to the online cookbook. It's not

> perfectly
>> formatted but still useful, i hope.

>
>> http://aspn.activestate.com/ASPN/Coo.../Recipe/361742

>
> Uhm... on my system I get:
>
>>>> german_ae = unicode('\xc3\xa4', 'utf8')
>>>> print german_ae # dunno if it will appear right on Google groups

> ä
>
>>>> german_ae.decode('latin1')

> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in
> position 0: ordinal not in range(12
> ?? What's wrong?


I'd rather use german_ae.encode('latin1')
^^^^^^

which returns '\xe4'.
>
> Michele Simionato


 
Reply With Quote
 
michele.simionato@gmail.com
Guest
Posts: n/a
 
      01-04-2005
Stephan:

> I'd rather use german_ae.encode('latin1')

^^^^^^
> which returns '\xe4'.


uhm ... then there is a misprint in the discussion of the recipe;
BTW what's the difference between .encode and .decode ?
(yes, I have been living in happy ASCII-land until now ...
I should probably ask for an unicode primer, I have found the
one by Marc André Lemburg
http://www.reportlab.com/i18n/python..._tutorial.html
and I am reading it right now.


Michele Simionato

 
Reply With Quote
 
Aahz
Guest
Posts: n/a
 
      01-04-2005
In article <. com>,
<> wrote:
>
>BTW what's the difference between .encode and .decode ?
>(yes, I have been living in happy ASCII-land until now ...


Here's the stark simple recipe: when you use Unicode, you *MUST* switch
to a Unicode-centric view of the universe. Therefore you encode *FROM*
Unicode and you decode *TO* Unicode. Period. It's similar to the way
floating point contaminates ints.
--
Aahz () <*> http://www.pythoncraft.com/

"19. A language that doesn't affect the way you think about programming,
is not worth knowing." --Alan Perlis
 
Reply With Quote
 
Skip Montanaro
Guest
Posts: n/a
 
      01-04-2005

michele> BTW what's the difference between .encode and .decode ?

I started to answer, then got confused when I read the docstrings for
unicode.encode and unicode.decode:

>>> help(u"\xe4".decode)

Help on built-in function decode:

decode(...)
S.decode([encoding[,errors]]) -> string or unicode

Decodes S using the codec registered for encoding. encoding defaults
to the default encoding. errors may be given to set a different error
handling scheme. Default is 'strict' meaning that encoding errors raise
a UnicodeDecodeError. Other possible values are 'ignore' and 'replace'
as well as any other name registerd with codecs.register_error that is
able to handle UnicodeDecodeErrors.

>>> help(u"\xe4".encode)

Help on built-in function encode:

encode(...)
S.encode([encoding[,errors]]) -> string or unicode

Encodes S using the codec registered for encoding. encoding defaults
to the default encoding. errors may be given to set a different error
handling scheme. Default is 'strict' meaning that encoding errors raise
a UnicodeEncodeError. Other possible values are 'ignore', 'replace' and
'xmlcharrefreplace' as well as any other name registered with
codecs.register_error that can handle UnicodeEncodeErrors.

It probably makes sense to one who knows, but for the feeble-minded like
myself, they seem about the same.

I'd be happy to add a couple examples to the string methods section of the
docs if someone will produce something simple that makes the distinction
clear.

Skip

 
Reply With Quote
 
michele.simionato@gmail.com
Guest
Posts: n/a
 
      01-04-2005
Yep, I did the same and got confused :-/

Michele

 
Reply With Quote
 
Skip Montanaro
Guest
Posts: n/a
 
      01-04-2005
aahz> Here's the stark simple recipe: when you use Unicode, you *MUST*
aahz> switch to a Unicode-centric view of the universe. Therefore you
aahz> encode *FROM* Unicode and you decode *TO* Unicode. Period. It's
aahz> similar to the way floating point contaminates ints.

That's what I do in my code. Why do Unicode objects have a decode method
then?

Skip

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dr. Dobb's Python-URL! - weekly Python news and links (Jul 21) Irmen de Jong Python 5 07-21-2003 10:53 PM
Dr. Dobb's Python-URL! - weekly Python news and links (Jul 14) Irmen de Jong Python 0 07-14-2003 08:44 AM
Dr. Dobb's Python-URL! - weekly Python news and links (Jul 7) Irmen de Jong Python 0 07-07-2003 12:02 PM
Dr. Dobb's Python-URL! - weekly Python news and links (Jun 30) Irmen de Jong Python 0 06-30-2003 10:58 AM
Re: Dr. Dobb's Python-URL! - weekly Python news and links (Sep 24) Cameron Laird Python 3 06-28-2003 04:55 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57