linux - Setup universal prefix for root path script in python -


i need launch same scripts different environnments:

   linux vm,    local linux vm,    windows vm,     local windows 

i use code setup fixed prefix root path each environnment:

dircwd= 'd:/google_cloud/home/aaa/project/'  if os.path.expanduser('~').find('as1') >-1  , sys.platform.find('win')>-1 else  'g:/_devs/google_cloud/home/bbbb/project/' if sys.platform.find('win')> -1 else  '/home/cccc/project/' if os.environ['home'].find('nol')>-1  else '/home/ccc/project/' 

all scripts dependant root environnment (i can copy paste full folder structure).

is there better way determine root folder python script ?


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -