Hello!

this is a simple wrapper for sacct which prints the
output from sacct as table. So you can make a 
"sacctml -j foo --long" even without two 8k displays ;-)

cheers
#!/usr/bin/python3


def sacct_command(cmd):

    cmd_list=["sacct","--parsable2"]
    cmd_list.extend(cmd)
    result=subprocess.check_output(cmd_list,encoding='utf-8')
    res_list=result.split('\n')
    return(res_list[0].split('|'),[x.split('|') for x in res_list[1:] if x])
    

if __name__ == "__main__":
    import sys
    import subprocess
    (header,result)=sacct_command(sys.argv[1:])
    for l in result:
        for f in range(len(header)):
    	    print("{0}: {1}".format(header[f],l[f]))

        print('--')

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to