[PyAR2] C++ vs. Python as teaching tool

Chad Cooper Chad_Cooper at SWN.COM
Tue Jan 15 21:02:57 CET 2008


My favorite 4 lines of Python -  sending email (in its rawest form)

 

import smtplib

server = smtplib.SMTP(email_server_ip)

server.sendmail(from, to, msg)

server.quit()

 

It still amazes me that you can send emails with that little bit 'o
code....

 

chad!

 

 

________________________________

From: pyar2-bounces at python.org [mailto:pyar2-bounces at python.org] On
Behalf Of W W
Sent: Tuesday, January 15, 2008 1:50 PM
To: pyar2 at python.org
Subject: Re: [PyAR2] C++ vs. Python as teaching tool

 

Okay so I'm not sure why it sent way before I was ready... I guess gmail
thought it was funny or something.

Anyhow, we didn't get to any programming, just flow-chart. The lab (2
hours) will be spent writing a program that took me about 5 minutes in
python. 

      1 name = raw_input('Enter Employee Name:')
      2 hours = int(raw_input('Enter Employee Hours Worked:'))
      3 wage = float(raw_input('Enter Employee Wages:'))
      4 print name, 'earned $' + str(wage*hours) 

Four lines. I don't even think I'll be able to write a program that does
/nothing/ in c++ with four lines.

MMmmm, python!

On Jan 15, 2008 1:40 PM, W W < srilyk at gmail.com
<mailto:srilyk at gmail.com> > wrote:

So...
I'm a student at UCA, taking my "Computer Science I" (read: coast class
for anyone who's written a program). 

They use C++ as the CSCI I and II language. I've become an avid... oh I
don't know what you call us python fans, but I've been one for quite a
while now. But this just took the lesson home even further. 

Today for the in-class lesson  

-- 
To be considered stupid and to be told so is more painful than being
called gluttonous, mendacious, violent, lascivious, lazy, cowardly:
every weakness, every vice, has found its defenders, its rhetoric, its
ennoblement and exaltation, but stupidity hasn't. - Primo Levi 




-- 
To be considered stupid and to be told so is more painful than being
called gluttonous, mendacious, violent, lascivious, lazy, cowardly:
every weakness, every vice, has found its defenders, its rhetoric, its
ennoblement and exaltation, but stupidity hasn't. - Primo Levi 


Notice:  This e-mail may contain privileged and/or confidential
information and is intended only for the addressee. If you are not the
addressee or the person responsible for delivering it to the addressee,
you may not copy or distribute this communication to anyone else. If you
received this communication in error, please notify us immediately by
telephone or return e-mail and promptly delete the original message from
your system.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/mailman/private/pyar2/attachments/20080115/fe97e865/attachment.htm 


More information about the PyAR2 mailing list