Skip to content
Snippets Groups Projects
Commit c00f2d52 authored by Katharina Baier's avatar Katharina Baier
Browse files

Update clear_ectrans_list_v2.py

parent 2f7df43a
No related branches found
No related tags found
No related merge requests found
"""
run on ECMWF-Server: python clear_ectrans_list_v2.py
package requirements: subprocess (pip install subprocess)
original author: A. Plach, updated by K. Baier
"""
from subprocess import check_output#, run
import subprocess
# 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 i,line in enumerate(out):
line_tmp = line.split()
procID = line_tmp[0]
try:
subprocess.check_call(['ecaccess-ectrans-delete', str(procID)])
print(str(procID))
except TypeError as e:
print(e)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment