본문 바로가기

Prog.Lang. or Query/Jython

환경변수 확인

import os
ftrg = open('c:/temp/listenv.txt', 'w')
try:
 envDict = os.environ
 osCurrentDirectory = os.getcwd()
 print >> ftrg, 'Current Directory: %s' % osCurrentDirectory
 print >> ftrg, '=============================='
 print >> ftrg, 'List of environment variables:'
 print >> ftrg, '=============================='
 for aKey in envDict.keys():
  print >> ftrg, '%s\t= %s' % (aKey, envDict[aKey])
 print >> ftrg, '=============================='
 print >> ftrg, 'Oracle Data Integrator specific environment variables:'
 print >> ftrg, '=============================='
 for aKey in envDict.keys():
  if aKey.startswith('SNP_'):
   print >> ftrg, '%s\t= %s' % (aKey, envDict[aKey])
finally:
 ftrg.close()