source: nappy/trunk/nappy/unit_tests/ck_test.py @ 3519

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/nappy/trunk/nappy/unit_tests/ck_test.py@3519
Revision 3519, 552 bytes checked in by ckilburn, 12 years ago (diff)

Annotation

Line 
1import unittest
2import os
3import sys
4
5# Import local modules
6base_dir = os.environ.get("NAPPY_BASE_DIR", "..\\..")
7sys.path.append(base_dir)
8
9import nappy
10import nappy.na_file.na_file
11
12infile = os.path.join(base_dir, "data_files", "1020.na")
13outfile = os.path.join(base_dir, "test_outputs", "test_1020.na")
14print "Opening the infile"
15fin = nappy.openNAFile(infile)
16fin.readData()
17na_dict = fin.getNADict()
18
19print "Opening and writing the outfile"
20fobj = nappy.openNAFile(outfile, mode="w", na_dict=na_dict)
21fobj.write(delimiter = ",   ")
22
23fobj.close()
Note: See TracBrowser for help on using the repository browser.