#NEWLINE# def print_( * args , **kwargs ) : #NEWLINE# #INDENT# 'The new-style print function for Python 2.4 and 2.5.' #NEWLINE# fp = kwargs . pop ( 'file' , sys . stdout ) #NEWLINE# if ( fp is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# def write( data ) : #NEWLINE# #INDENT# if ( not isinstance ( data , basestring ) ) : #NEWLINE# #INDENT# data = str ( data ) #NEWLINE# #UNINDENT# if ( isinstance ( fp , file ) and isinstance ( data , unicode ) and ( fp . encoding is not None ) ) : #NEWLINE# #INDENT# errors = getattr ( fp , 'errors' , None ) #NEWLINE# if ( errors is None ) : #NEWLINE# #INDENT# errors = 'strict' #NEWLINE# #UNINDENT# data = data . encode ( fp . encoding , errors ) #NEWLINE# #UNINDENT# fp . write ( data ) #NEWLINE# #UNINDENT# want_unicode = False #NEWLINE# sep = kwargs . pop ( 'sep' , None ) #NEWLINE# if ( sep is not None ) : #NEWLINE# #INDENT# if isinstance ( sep , unicode ) : #NEWLINE# #INDENT# want_unicode = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not isinstance ( sep , str ) ) : #NEWLINE# #INDENT# raise TypeError ( 'sep must be None or a string' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# end = kwargs . pop ( 'end' , None ) #NEWLINE# if ( end is not None ) : #NEWLINE# #INDENT# if isinstance ( end , unicode ) : #NEWLINE# #INDENT# want_unicode = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not isinstance ( end , str ) ) : #NEWLINE# #INDENT# raise TypeError ( 'end must be None or a string' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if kwargs : #NEWLINE# #INDENT# raise TypeError ( 'invalid keyword arguments to print()' ) #NEWLINE# #UNINDENT# if ( not want_unicode ) : #NEWLINE# #INDENT# for arg in args : #NEWLINE# #INDENT# if isinstance ( arg , unicode ) : #NEWLINE# #INDENT# want_unicode = True #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if want_unicode : #NEWLINE# #INDENT# newline = unicode ( '\n' ) #NEWLINE# space = unicode ( ' ' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# newline = '\n' #NEWLINE# space = ' ' #NEWLINE# #UNINDENT# if ( sep is None ) : #NEWLINE# #INDENT# sep = space #NEWLINE# #UNINDENT# if ( end is None ) : #NEWLINE# #INDENT# end = newline #NEWLINE# #UNINDENT# for ( i , arg ) in enumerate ( args ) : #NEWLINE# #INDENT# if i : #NEWLINE# #INDENT# write ( args ) #NEWLINE# #UNINDENT# write ( arg ) #NEWLINE# #UNINDENT# write ( end )