# append routine path e.g. "olib.py" sys.path.append('/home/ou/ou/codes/lib/') import olib as ob #----------------------------------------------------------------------------- #- choose a job to perform - #----------------------------------------------------------------------------- jobs = {} jobs['a'] = "Yu's GPE Model" jobs['b'] = "test shallow water model" jobs['c'] = "swmod" #loopList = ['y','','yes','Y','yeah'] ob.greenLine() ob.printDic(jobs) ans = ob.greenInput('\n choose: ') # read codes of Yu's global primitive model #----------------------------------------------------------------------------- yesList = ['y','','Y','yes','yeah'] if ans == 'a' or ans == '': os.chdir('/home/ou/ou/codes/ymod') os.popen(r'"gvim" Main.f90') elif ans == 'b': os.chdir('/home/ou/temp/ymod/') os.popen(r'"gvim" Main.f90') elif ans == 'c': os.chdir('/home/ou/ou/codes/swmod') os.popen(r'"gvim" swmod.py') else:
#----------------------------------------------------------------------------- line = '______________________________________________________________________\n' cline = ob.color(line,'green','bold') print(cline) choices = {} choices['a'] = "math: Principles of Mathematical Analysis, Rudin 1976" choices['b'] = "physics: Feynman Lectures on Physics" choices['c'] = "atmos. science: Atmospheric Science, Wallace 2006" choices['d'] = "dynamics meteo.: An Introduction to Dynamic Meteorology, Holton 2004" choices['e'] = 'programming python' choices['f'] = 'Sage tutorial' choices['g'] = 'Asymptote tutorial' loopList = ['y','','yes','Y','yeah'] ob.printDic(choices) choice = input(ob.color('\n choose: ','green','bold')) # choose a book to read #----------------------------------------------------------------------------- bookDir = '/home/ou/ou/docs/books/' sageDir = '/home/ou/sage/' asyDir = '/home/ou/temp/asymptote/' os.chdir(bookDir) if choice == 'a' or choice == '': os.popen(r'"evince" mathematics/Rudin1976.pdf') elif choice == 'b': os.popen(r'"evince" physics/FeynmanLectures/Volume1.pdf') elif choice == 'c': os.popen(r'"evince" AtmosScience/Wallace2006.pdf') elif choice == 'd':
print(' find new note: '+srcDir+note) os.symlink(srcDir+note,'o'+note) # update tags #----------------------------------------------------------------------------- print('\n updating tags...') os.system(r'"vim" -c "helptags ~/.vim/doc" -c "q"') elif case == 'b': workDir = '/home/ou/ou/docs/notes/learn/' os.chdir(workDir) mainTexFile = 'main.tex' chapters = {} chapters['a'] = ' Chapter: Academic' chapters['b'] = ' Chapter: programming' print('\n %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%') ob.printDic(chapters) chapter = input('\n choose chapter: ') if chapter in ['a','']: includeChapter = 'chapter/academic' elif chapter == 'b': includeChapter = 'chapter/programming' else: print('\n wrong selection.') sys.exit(1) gvim = 'gvim' + ' '+ includeChapter + '.tex' os.popen(gvim) #----------------------------------------------------------------------------- # compile the tex source file compileIt = input('\n compile it?(y/n): ') if compileIt in yesList: