[Tutor] Parsing html tables and using numpy for subsequentprocessing

Alan Gauld alan.gauld at btinternet.com
Wed Sep 16 09:50:04 CEST 2009


"David Kim" <davidkim05 at gmail.com> wrote

> The code can be found at pastebin:
> http://financialpython.pastebin.com/f4efd8930

Nothing to do with the parsing but I noticed:

def get_files(path): 
      ''' Get a list of all files in a given directory. 
          Returns a list of filename strings. ''' 
      files = os.listdir(path) 
      return files 

Since you are just returning the result of listdir you 
could achieve the same effect by simply aliasing listdir:

get_files = os.listdir


Much less typing!


HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090916/a6c27b7a/attachment.htm>


More information about the Tutor mailing list