Changeset 3618 for nappy/trunk


Ignore:
Timestamp:
17/03/08 01:33:45 (12 years ago)
Author:
astephen
Message:

Added no_header option to allow user to specify writing the body only.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nappy/trunk/nappy/na_file/na_file.py

    r3529 r3618  
    7676        self.is_open = True 
    7777 
    78     def write(self, delimiter="    ", float_format="%8.3f", annotation=False): 
     78    def write(self, delimiter="    ", float_format="%8.3f", annotation=False, no_header=False): 
    7979        """ 
    8080        Writes an na_dict to the file and then flushes it to ensure data not  
    8181        being buffered. 
     82        If annotation is True then add annotation column to left of file. 
     83        If no_header is True then suppress writing the header and only write the data section.  
    8284        """  
    8385        self.delimiter = delimiter 
     
    99101        self._parseDictionary() 
    100102        self.header = StringIO.StringIO() 
    101         self.writeHeader() 
     103 
     104        if no_header == False: 
     105            self.writeHeader() 
     106 
    102107        self.writeData() 
    103108        self.file.flush() 
Note: See TracChangeset for help on using the changeset viewer.