def write_pid(program_name, pid_files_dir=None):
 pidfile = open(get_pid_path(program_name, pid_files_dir), 'w')
 try:
  pidfile.write(('%s\n' % os.getpid()))
 finally:
  pidfile.close()

def write_pid ( program_name , pid_files_dir = None ) : pidfile = open ( get_pid_path ( program_name , pid_files_dir ) , 'w' ) try : pidfile . write ( ( '%s\n' % os . getpid ( ) ) ) finally : pidfile . close ( )
write our pid to a pidfile .