def setup_pid_file():
 config = odoo.tools.config
 if ((not odoo.evented) and config['pidfile']):
  pid = os.getpid()
  with open(config['pidfile'], 'w') as fd:
   fd.write(str(pid))
  atexit.register(rm_pid_file, pid)

def setup_pid_file ( ) : config = odoo . tools . config if ( ( not odoo . evented ) and config [ 'pidfile' ] ) : pid = os . getpid ( ) with open ( config [ 'pidfile' ] , 'w' ) as fd : fd . write ( str ( pid ) ) atexit . register ( rm_pid_file , pid )
create a file with the process id written in it .