Chapter 23


3.

Web services and the csv module

Replace the for loop in stock.py with the following:

import csv for tick, price, chg, per in csv.reader(f):     print tick.ljust(7), ('%.2f' % round(float(price), 2)).rjust(6), chg.rjust(6), per.rjust(6)




Core Python Programming
Core Python Programming (2nd Edition)
ISBN: 0132269937
EAN: 2147483647
Year: 2004
Pages: 334
Authors: Wesley J Chun

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net