def getpcmd(pid):
    if os.name == "nt":
        # Use wmic command instead of ps on Windows.
        cmd = 'wmic path win32_process where ProcessID=%s get Commandline' % (pid, )
        with os.popen(cmd, 'r') as p:
            lines = [line for line in p.readlines() if line.strip("\r\n ") != ""]
            if lines:
                _, val = lines
                return val
    else:
        cmd = 'ps -o pid,args'
        with os.popen(cmd, 'r') as p:
            # Skip the column titles
            p.readline()
            for line in p:
                spid, scmd = line.strip().split(' ', 1)
                if int(spid) == int(pid):
                    return scmd
Read old pack tag
dataset/ETHPy150Open spotify/luigi/luigi/lock.py/getpcmd--crossover with--dataset/ETHPy150Open mne-tools/mne-python/mne/io/tag.py/_read_old_pack