SiaProgrammingPython

Input/Output

This lesson deals with the ways of reading and writing data

Basic Python

The file object is used for reading and writing plain text as well as unformatted binary data. The following Codeline writes a message in the file with the name out.txt

   1 file('out.txt','wb').write('Hallo Datentraeger')

The data can be read in with the method .read()

   1 s=file('out.txt').read()
   2 print s
   3 'Hallo Datentraeger'

NumPy/SciPy

HDF

netCDF

Various Satellite data formats