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)
- ''.join(): join list of lines with an empty char

Malcolm
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to