Is there any way to add new records in the file with each field occupying specific size using python? As shown in below picture, there are together 8 columns
[column number:column bytes] ->[1:20,2:10,3:10,4:39, 6:2, 7:7,8:7]
each of different size. For example if first column value is of 20 bytes "ABBSBABBSBT ", this can contain either 10,5 or can occupy entire 20 bytes depending upon user input.
In C language, we can specify the byte size during the variable initialization.
How one can add new record with proper fixed spacing for each column?
Thank you in advance!