human
Give me a the Python program you requested given the following:
I am working on the file "Devel/V05/Frame2D_Output.ipynb".
The first task is:
General Table Writing
Define a general method to write all tables.  By default, a table of a given name
will be used from the 'self.rawdata' object.  If table 'xxx' does not exist
there, it will be created by calling method '.list_xxx()' to generate the data,
and formed by using the list of columns in class attribute '.COLUMNS_xxx'.
.list_xxx() must return a list of tuples or dictionaries, each of these being one
row of the table.  If a tuple, that data is obviously given in the same order as the columns.
If a dictionary, the keys are the column names (see 'Member Loads', below).
Can you write Python program for it?
assistant
#Here is the Python program you requested.

@extend
class Frame2D:
    
    def write_table(self,table_name,ds_name=None,prefix=None,record=True,precision=None,args=(),makedir=False):
        t = getattr(self.rawdata,table_name,None)
        if t is None:
            methodname = 'list_'+table_name
            method = getattr(self,methodname,None)
            if method and callable(method):
                data = method(*args)
                t = Table(table_name,data=data,columns=getattr(self,'COLUMNS_'+table_name))
        if t is None:
            raise ValueError("Unable to find table '{}'".format(table_name))
        t.write(ds_name=ds_name,prefix=prefix,precision=precision,makedir=makedir)
        if record:
            setattr(self.rawdata,table_name,t)
        return t            

##test:
try:
    f.write_table('foobarzx3')
except Exception, e:
    print('**** Error:',e)