https://github.com/geodynamics/citcoms
Revision 255fd82ed7b1d4b78ce38470672290ed30dbe2ef authored by Rajesh Kommu on 25 June 2014, 22:53:47 UTC, committed by Rajesh Kommu on 25 June 2014, 22:53:47 UTC
1 parent 573c33f
Raw File
Tip revision: 255fd82ed7b1d4b78ce38470672290ed30dbe2ef authored by Rajesh Kommu on 25 June 2014, 22:53:47 UTC
Updated Cookbook 6 in the CitcomS manual to the pure C version
Tip revision: 255fd82
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 )
back to top