def _FormatAsEnvironmentBlock(envvar_dict):
 block = ''
 nul = '\x00'
 for (key, value) in envvar_dict.iteritems():
  block += (((key + '=') + value) + nul)
 block += nul
 return block

def _FormatAsEnvironmentBlock ( envvar_dict ) : block = '' nul = '\x00' for ( key , value ) in envvar_dict . iteritems ( ) : block += ( ( ( key + '=' ) + value ) + nul ) block += nul return block
format as an environment block directly suitable for createprocess .