#NEWLINE# def show_actor_dictionary( filename = '' ) : #NEWLINE# #INDENT# if ( len ( filename ) > 0 ) : #NEWLINE# #INDENT# fout = open ( filename , 'w' ) #NEWLINE# fout . write ( 'PETRARCH Actor Dictionary and Actor Codes Internal Format\n' ) #NEWLINE# fout . write ( ( ( 'Run time: ' + PETRglobals . RunTimeString ) + '\n' ) ) #NEWLINE# for ( locword , loclist ) in PETRglobals . ActorDict . items ( ) : #NEWLINE# #INDENT# fout . write ( ( ( ( locword + ' ::\n' ) + str ( loclist ) ) + '\n' ) ) #NEWLINE# #UNINDENT# fout . write ( '\nActor Codes\n' ) #NEWLINE# ka = 0 #NEWLINE# while ( ka < len ( PETRglobals . ActorCodes ) ) : #NEWLINE# #INDENT# fout . write ( ( ( ( str ( ka ) + ': ' ) + str ( PETRglobals . ActorCodes [ ka ] ) ) + '\n' ) ) #NEWLINE# ka += 1 #NEWLINE# #UNINDENT# fout . close ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for ( locword , loclist ) in PETRglobals . ActorDict . items ( ) : #NEWLINE# #INDENT# print ( locword , '::' ) #NEWLINE# if isinstance ( loclist [ 0 ] [ 0 ] , str ) : #NEWLINE# #INDENT# print ( loclist ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print ( 'PTR,' , fout )