Friday, February 25, 2011

Find out on which computer you are 'python-ing'

Often, data is stored at different locations, depending on which computer the code is running.
To find out one can use the sys module like this:


import sys
if sys.platform == 'darwin':
    base = '/Users/aye/Data/hirise/'
else:
    base = '/processed_data/'

No comments:

Post a Comment