On 07/12/2010 11:29 PM, pyt...@bdurham.com wrote: > Jia, > > print ''.join( open( 'Direct_Irr.txt' ).read().split() ) > > Broken out: > > - open(): open file > - read(): read its entire contents as one string > - split(): split the contents into a list of lines > (splits lines at \n; does not include \n in split values)
also splits at other whitespace. > - ''.join(): join list of lines with an empty char > > Malcolm -- http://mail.python.org/mailman/listinfo/python-list