Skip to content
Snippets Groups Projects
Commit ca18c187 authored by Timo Koch's avatar Timo Koch
Browse files

[bin][extractlinedata] Small improvements

* Make make dir of output dir more consise and handle "  " case
* simplify verbose output
parent 9fe97d9e
No related branches found
No related tags found
1 merge request!2207Feature/improve extract line data
......@@ -24,8 +24,8 @@ except:
# import locations
outDirectory = args['outputDirectory']
if not outDirectory == '' and not os.path.exists(outDirectory):
os.makedirs(outDirectory)
if outDirectory.strip():
os.makedirs(outDirectory, exist_ok=True)
# loop over all vtk files
counter = 0
......@@ -68,11 +68,8 @@ for curFile in args['files']:
# print the parameters and the column numbers
if args['verbosity'] == 2:
with open(csvFileName) as f:
with open(csvFileName) as csvFile:
print(csvFileName)
reader = csv.reader(f)
paramList = list(reader)
paramCounter=1
for param in paramList[0]:
print("%-2i %s" % (paramCounter, param))
paramCounter += 1
paramList = list(csv.reader(csvFile))[0]
for i, param in enumerate(paramList):
print("{:>5} {}".format(i+1, param))
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