https://github.com/geodynamics/citcoms
Tip revision: 0473ed5e226f2a1bc702fb1c6f1210ee721ddc33 authored by Rene Gassmoeller on 03 November 2022, 16:37:30 UTC
Merge pull request #10 from ljhwang/patch-1
Merge pull request #10 from ljhwang/patch-1
Tip revision: 0473ed5
citcoms_datadir
#!/usr/bin/env python
def get_var():
# get your username on this machine, and make it upper case
import os
var = os.environ.get("USER")
return var.upper()
# invariant prefix of datadir
prefix = "/scratch/"
# invariant suffix of datadir
suffix = ""
# get the machine-dependent part of datadir
var_path = get_var()
# construct the full string for datadir
print "%s%s%s" % ( prefix, var_path, suffix )