diff --git a/clear_ectrans_list.py b/clear_ectrans_list.py new file mode 100644 index 0000000000000000000000000000000000000000..f29de8e131e0e028cefd409598475a5b5b11776e --- /dev/null +++ b/clear_ectrans_list.py @@ -0,0 +1,14 @@ +from subprocess import check_output, run + +# write output of ecaccess-ectrans-list to a variable, but transfer it +# to a string (from bytes format) and split at newline +out = str(check_output(['ecaccess-ectrans-list'])).split('\\n') + +for line in out: + line_tmp = line.split() + procID = line_tmp[0] + print(procID) + try: + run(['ecaccess-ectrans-delete', str(procID)]) + except TypeError as e: + print(e)