def get_pid(pidfile):
 pid = None
 if os.path.exists(pidfile):
  with open(pidfile, 'r') as f:
   pid = f.read()
 return pid

def get_pid ( pidfile ) : pid = None if os . path . exists ( pidfile ) : with open ( pidfile , 'r' ) as f : pid = f . read ( ) return pid
get the pid by trying to access an pid file .