from utils import write_csv_rows, read_csv_rows

class input_table:
    def __init__(self, filename, content):
        self.filename = filename
        self.content = content

connect_tbl=input_table('connectivity.csv',
                        [['Connectivity Table'],
                         ['x1','y1','x2','y2','E','A']])
force_tbl=input_table('forces.csv',
                      [['Force Table'],
                       ['x','y','Fx','Fy']])
bc_tbl=input_table('boundary_conditions.csv',
                   [['Boundary Conditions'],
                    ['x','y','Constrained Dimension','Displacement']])
sim_tbl=input_table('simulation_parameters.csv',
                    [['Simulation Parameters'],
                     ['Numerical Soln Multiplier','Degrees of Freedom'],
                     ['1e9']])

input_files=[connect_tbl,force_tbl,bc_tbl,sim_tbl]

for i in range(0,len(input_files)):
    write_csv_rows(input_files[i].filename,input_files[i].content)
    print(input_files[i].content[0][0] + ' written to ' + input_files[i].filename)

@@ -93,24 +93,39 @@
 ilename,
+ name, headers,
  content
 ):%0A     
@@ -116,16 +116,19 @@
  content
+=%5B%5D
 ):%0A     
@@ -172,39 +172,221 @@
 elf.
-content = content%0A%0Aconnect_tbl=
+name = name%0A        self.headers = headers%0A        self.content = content%0A%0Aconnect_filename = 'connectivity.csv'%0Aconnect_name = %5B'Connectivity Table'%5D%0Aconnect_headers = %5B'x1','y1','x2','y2','E','A'%5D%0Aconnect_tbl = 
 inpu
@@ -393,34 +393,32 @@
 t_table(
-'
 connect
-ivity.csv'
+_filename
 ,%0A      
@@ -439,31 +439,22 @@
     
-%5B%5B'C
+  c
 onnect
-ivity Table'%5D
+_name
 ,%0A  
@@ -480,39 +480,121 @@
     
-%5B'x1','y1',
+ connect_headers)%0A%0Aforce_filename = 'forces.csv'%0Aforce_name = %5B'Force Table'%5D%0Aforce_headers = %5B
 'x
-2
 ','y
-2
 ','
-E','A'%5D%5D)
+Fx','Fy'%5D
 %0Afor
@@ -595,25 +595,27 @@
 '%5D%0Aforce_tbl
-=
+ = 
 input_table(
@@ -614,28 +614,30 @@
 t_table(
-'
 force
-s.csv'
+_filename
 ,%0A      
@@ -656,24 +656,20 @@
     
-%5B%5B'Force Table'%5D
+  force_name
 ,%0A  
@@ -693,49 +693,39 @@
     
-%5B'x','y','Fx','Fy'%5D%5D
+ force_headers
 )%0A
+%0A
 bc_
-tbl=input_table(
+filename = 
 'bou
@@ -749,30 +749,19 @@
 csv'
-,%0A                   %5B
+%0Abc_name = 
 %5B'Bo
@@ -779,37 +779,29 @@
 itions'%5D
-,%0A                   
+%0Abc_headers =
  %5B'x','y
@@ -845,19 +845,18 @@
 nt'%5D
-%5D)%0Asim
+%0Abc
 _tbl
-=
+ = 
 inpu
@@ -863,16 +863,108 @@
 t_table(
+bc_filename,%0A                     bc_name,%0A                     bc_headers)%0A%0Asim_filename = 
 'simulat
@@ -986,31 +986,20 @@
 csv'
-,%0A                    %5B
+%0Asim_name = 
 %5B'Si
@@ -1019,38 +1019,30 @@
 meters'%5D
-,%0A                    
+%0Asim_headers =
  %5B'Numer
@@ -1088,39 +1088,167 @@
 om'%5D
-,%0A                     %5B'1e9'%5D%5D
+%0Asim_content = %5B'1e9'%5D%0Asim_tbl = input_table(sim_filename,%0A                      sim_name,%0A                      sim_headers,%0A                      sim_content
 )%0A%0Ai
@@ -1257,17 +1257,19 @@
 ut_files
-=
+ = 
 %5Bconnect
@@ -1344,47 +1344,97 @@
     
-write_csv_rows(input_files%5Bi%5D.filename,
+tbl_list = %5Binput_files%5Bi%5D.name,%0A                input_files%5Bi%5D.headers,%0A                
 inpu
@@ -1455,19 +1455,28 @@
 tent
-)
+%5D
 %0A    
-p
+w
 ri
-n
 t
+e_csv_rows
 (inp
@@ -1491,18 +1491,56 @@
 %5Bi%5D.
-content%5B0%5D
+filename,tbl_list)%0A    print(input_files%5Bi%5D.name
 %5B0%5D 
@@ -1557,16 +1557,27 @@
 n to ' +
+%5C%0A         
  input_f

Clean up input tables class and instance declarations