I'm trying to get a good solution for a (de-)serializer. I've got a format pattern and all the values to put in.
The format pattern is as follows:
msg = '$bla,%d,%02d,%02d %02d:%02d:%02d.%03d' % (kwargs['...'], ...)
When I serialize the values, I get the following string:
bla,1990,12,24 13:37:11.001
But I also have to deserialize it. The pattern can strongly vary in length and types. I'd like to deserialize the string based only on the format pattern.
Any ideas how this is achievable?
EDIT: I'm using Python 2.7.6