示例#1
0
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':
    os.popen(r'"evince" AtmosScience/DynamicMeteo/Holton2004/Holton2004.pdf')
elif choice == 'e':
    os.popen(r'"evince" python/Programming_4th.pdf &')
elif choice == 'f':
    os.chdir(sageDir)
    filename = 'file:///home/ou/sage/devel/sage-main/doc/output/pdf/en/tutorial/SageTutorial.pdf'
    cmd = 'evince ' + filename
    os.popen(cmd)
elif choice == 'g':
    os.chdir(asyDir)
    gvim = 'gvim ' + 'test.asy'
    chrome = 'chromium-browser &'
    os.popen(chrome)
    os.popen(gvim)
else:
    print(ob.color('\n You do not select any subject.','green','bold'))

#-----------------------------------------------------------------------------
#- End script                                                                -
#-----------------------------------------------------------------------------
ob.regularEnd('Enjoy learning!')
示例#2
0
文件: docs.py 项目: ouyuyuan/oldcoded
    includes['d'] = ' 搜集文档'
    includes['e'] = ' 课件材料'
    includes['f'] = ' 表格通知名单'
    ob.greenLine()
    ob.printDic(includes)
    include = ob.greenInput('\n choose a category: ')

    if include in ['a','']: category = 'swdocs'
    elif include == 'b': category = 'books'
    elif include == 'c': category = 'created'
    elif include == 'd': category = 'collected'
    elif include == 'e': category = 'lectures'
    elif include == 'f': category = 'office'
    else:
        ob.redText('\n wrong selection.')
        sys.exit(1)
    gvim = 'gvim ' + 'include/'+ category + '.tex'
    os.popen(gvim)
    #-----------------------------------------------------------------------------
    # compile the tex source file                                                 
    compileIt = ob.greenInput('\n compile it?(y/n): ')
    if compileIt in yesList: ob.xelatex(mainTexFile)

else:
    print('\n do not select any note.')

#-----------------------------------------------------------------------------
#- end script                                                                -
#-----------------------------------------------------------------------------
ob.regularEnd('Enjoy onote-system!')
示例#3
0
文件: job.py 项目: ouyuyuan/oldcoded
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:
    ob.greenText('do not select any job...')

#-----------------------------------------------------------------------------
#- end script                                                                -
#-----------------------------------------------------------------------------

ob.regularEnd('Have passion with the job!')
示例#4
0
    doc = 'books/python/PocketReference_4th.pdf'
elif choice == 'c':
    doc = 'books/python/LearningPython_4th.pdf'
elif choice == 'd':
    doc = 'swdocs/vim/vimqrc.pdf'
elif choice == 'e':
    doc = 'books/python/Programming_4th.pdf'
elif choice == 'g':
    doc = 'index.pdf'
elif choice == 'h':
    doc = 'notes/learn/main.pdf'
elif choice == 'j':
    doc = 'files/EmacsColors/EmacsColors.pdf'
elif choice == 'k':
    doc = 'books/AtmosScience/MetDict.pdf'
else:
    print(ob.color('\n Select NONE. Exiting...','green','bold'))
    sys.exit(1)
cmd = 'evince '+doc+' &'
os.system(cmd)



#-----------------------------------------------------------------------------
#- End script                                                                -
#-----------------------------------------------------------------------------
#smile = ob.color('^_^','on_red','magenta','reverse','bold')
#text = ob.color('\n Done.\n \n Have fun! ','green','bold')
#ending = text + smile + '\n'
ob.regularEnd('Have fun!')