#NEWLINE# def callback_func( out_dict , extra_prms = None ) : #NEWLINE# #INDENT# with open ( 'test.txt' , 'a' ) as myfile : #NEWLINE# #INDENT# myfile . write ( '\n' ) #NEWLINE# myfile . write ( 'OUT_DICT:\n' ) #NEWLINE# myfile . write ( json . dumps ( out_dict ) ) #NEWLINE# if extra_prms : #NEWLINE# #INDENT# myfile . write ( '\nEXTRA_PRMS:\n' ) #NEWLINE# myfile . write ( json . dumps ( extra_prms ) ) #NEWLINE# #UNINDENT# myfile . write ( '\n' )