Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 26th, 2004, 9:34 AM   #11
clifford.will
Newbie
 
Join Date: Aug 2004
Location: Florida
Posts: 11
Rep Power: 0 clifford.will is on a distinguished road
exactly B)

plus there is lots of code out there to read through to get an idea of how it should and should not be written.

I think one of the neatest things about the language is the ability to slurp a file into an array according to the lines in the file in two or three lines of code. Can't do that in C .... C++, yes, if you use the STL, but even then, it's not as clean and understandable. Plus you can filter the lines that you want in the same operation in Python -- that I know you can't do with C++.

ex.

import re

r = re.compile('^MyMatch', re.IGNORECASE)
f = open('my.dat', 'r')
lines_I_want = [ x for x in f if r.match(x) ]
f.close()

sweeeeeet
clifford.will is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:01 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC