fork download
  1. job_IDs = ['13453', '123', '563456']
  2. memory_used = [30, 150.54, 20.6]
  3. memory_units = ['MB', 'GB', 'MB']
  4.  
  5. width = max(map(len, job_IDs)) + 1 # +1 for ':'
  6. for jid, mem, unit in zip(job_IDs, memory_used, memory_units):
  7. print("Job {jid:{width}} {part[0]:>3}{part[1]:1}{part[2]:<2} {unit:2}".format(
  8. jid=jid+':', width=width, part=str(mem).partition('.'), unit=unit))
  9.  
Success #stdin #stdout 0.02s 5852KB
stdin
Standard input is empty
stdout
Job 13453:   30    MB
Job 123:    150.54 GB
Job 563456:  20.6  MB