473,387 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Beautiful Code in Python?

js
Hi,

Have you ever seen Beautiful Python code?
Zope? Django? Python standard lib? or else?

Please tell me what code you think it's stunning.
Mar 2 '08 #1
8 2752
On Mar 2, 5:23 pm, js <ebgs...@gmail.comwrote:
Hi,

Have you ever seen Beautiful Python code?
Zope? Django? Python standard lib? or else?

Please tell me what code you think it's stunning.
The doctest module in the standard library.

M.S.
Mar 2 '08 #2
On Mon, 3 Mar 2008 01:23:32 +0900, js <eb*****@gmail.comwrote:
>Hi,

Have you ever seen Beautiful Python code?
Zope? Django? Python standard lib? or else?

Please tell me what code you think it's stunning.
Just about any Python code I look at.
Mar 2 '08 #3
On Mar 2, 12:01*pm, John DeRosa <stug...@qwest.netwrote:
On Mon, 3 Mar 2008 01:23:32 +0900, js <ebgs...@gmail.comwrote:
Hi,
Have you ever seen Beautiful Python code?
Zope? Django? Python standard lib? or else?
Please tell me what code you think it's stunning.

Just about any Python code I look at.
Decorators, with, and namedtuple.
Mar 2 '08 #4
js a écrit :
Hi,

Have you ever seen Beautiful Python code?
Zope? Django? Python standard lib? or else?

Please tell me what code you think it's stunning.
FormEncode has some very interesting parts IMHO.
Mar 3 '08 #5
On Mar 2, 8:35*am, Michele Simionato <michele.simion...@gmail.com>
wrote:
On Mar 2, 5:23 pm, js <ebgs...@gmail.comwrote:
Hi,
Have you ever seen Beautiful Python code?
Zope? Django? Python standard lib? or else?
Please tell me what code you think it's stunning.

The doctest module in the standard library.

*M.S.
The first thing of beauty I found in Python (coming from C, C++, and
perl) was the way Python handled variables, or as someone recently
described them, names.

Python's "for" statement is always beautiful to look at. Especially
when someone uses the else clause rather than trying to detect if the
list was exhausted. I sometimes avoid using the comprehensions just to
get an excuse to write another for loop in Python. There can never be
enough for loops written in Python!

Also, Python's iterator interface is by far the most beautiful thing I
have ever seen in the world of programming. Of course, the reason why
the for loop is so beautiful is because iterators are so beautiful.
Mar 3 '08 #6
Please tell me what code you think it's stunning.

Pexpect is (almost) pseudocode is (almost) poetry to my ears. And
there's a lot of narrative in it as well:

http://pexpect.svn.sourceforge.net/v...e=text%2Fplain
Mar 3 '08 #7
On Mar 2, 1:18*pm, castiro...@gmail.com wrote:
On Mar 2, 12:01*pm, John DeRosa <stug...@qwest.netwrote:
On Mon, 3 Mar 2008 01:23:32 +0900, js <ebgs...@gmail.comwrote:
>Hi,
>Have you ever seen Beautiful Python code?
>Zope? Django? Python standard lib? or else?
>Please tell me what code you think it's stunning.
Just about any Python code I look at.

Decorators, with, and namedtuple.
<running gag>Oh yeah, and variable arguments and keyword
dictionaries.<throat clear/></running gag>
Mar 9 '08 #8
On Mar 9, 6:44*pm, castiro...@gmail.com wrote:
On Mar 2, 1:18*pm, castiro...@gmail.com wrote:
On Mar 2, 12:01*pm, John DeRosa <stug...@qwest.netwrote:
On Mon, 3 Mar 2008 01:23:32 +0900, js <ebgs...@gmail.comwrote:
Hi,
Have you ever seen Beautiful Python code?
Zope? Django? Python standard lib? or else?
Please tell me what code you think it's stunning.
Just about any Python code I look at.
Decorators, with, and namedtuple.

<running gag>Oh yeah, and variable arguments and keyword
dictionaries.<throat clear/></running gag>
If you're C++, garbage collection. How's the cycle detector? The
pages and pages get pretty specific.
Mar 21 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

38
by: vinjvinj | last post by:
I haven't used an IDE in a long time but gave wing ide a try because I wanted the same development platform on Linux and Windows. I'm currently using Ultraedit and it works fine but needed...
8
by: Gekitsuu | last post by:
I've been reading a lot of python modules lately to see how they work and I've stumbled across something that's sort of annoying and wanted to find out of there was a good reason behind it. In a...
3
by: Max | last post by:
I have a friend who has been programming in C for many years, and he is a great fan of the language. However, he (and I) are about to start a python course, and he has been asking me a lot of...
1
by: Tempo | last post by:
Heya. I have never used a module/script before, and the first problem I have run into is that I do not know how to install a module/script. I have downloaded Beautiful Soup, but how do I use it in...
0
by: Anthra Norell | last post by:
Hi, Martin, SE is a stream editor that does not introduce the overhead and complications of overkill parsing. See if it suits your needs: http://cheeseshop.python.org/pypi/SE/2.2%20beta ...
3
by: cjl | last post by:
I am learning python and beautiful soup, and I'm stuck. A web page has a table that contains data I would like to scrape. The table has a unique class, so I can use: soup.find("table",...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.