![]()
#!/usr/bin/python
import sys
import subprocess
def play(filename):
player = "/usr/bin/mplayer"
fname = "/home/david/Desktop/core_video/data/" + filename
subprocess.call([player, fname])
def playall(files):
for name in files:
play(name)
def lesson1():
files =['python_0000.flv', 'python_0100a.flv',
'python_0101.flv', 'python_0102.flv',
'python_0103.flv', 'python_0104.flv']
playall(files)
menu()
def lesson2():
files =['python_0200a.flv', 'python_0201.flv',
'python_0202.flv', 'python_0203.flv',
'python_0204.flv']
playall(files)
menu()
def lesson3():
files =['python_0300a.flv', 'python_0301.flv',
'python_0302.flv', 'python_0303.flv',
'python_0304.flv']
playall(files)
menu()
def lesson4():
files =['python_0400a.flv', 'python_401.flv',
'python_0402.flv', 'python_0403.flv',
'python_0404.flv', 'python_0405.flv']
playall(files)
menu()
def lesson5():
files =['python_0500a.flv', 'python_0501.flv',
'python_0502.flv', 'python_0503.flv',
'python_0504.flv']
playall(files)
menu()
def lesson6():
files =['python_0600a.flv', 'python_0601.flv',
'python_0602.flv', 'python_0603.flv',
'python_0604.flv']
playall(files)
menu()
def lesson7():
files =['python_700a.flv', 'python_0701.flv',
'python_0702.flv', 'python_0703.flv',
'python_0704.flv']
playall(files)
menu()
def lesson8():
files =['python_0800a.flv', 'python_0801.flv',
'python_0802.flv', 'python_0803.flv',
'python_0804.flv', 'python_0805.flv',
'python_0806.flv']
playall(files)
menu()
def lesson9():
files =['python_0900a.flv', 'python_0901.flv',
'python_0902.flv', 'python_0903.flv',
'python_0904.flv', 'python_0905.flv',
'python_0906.flv']
playall(files)
menu()
def lesson10():
files =['python_1000a.flv', 'python_1001.flv',
'python_1002.flv', 'python_1003.flv',
'python_1004.flv', 'python_1005.flv',
'python_1006.flv']
playall(files)
menu()
def menu():
print """
Python Fundamentals by Wesley J. Chun
Press A: Introduction Press F: Loops and Conditionals
Press B: Getting Started Press G: Files and Input/Output
Press C: Syntax Basics Press H: Errors and Exceptions
Press D: Standard Types Press I: Functions and Functional Programming
Press E: Objects* and Memory Model Press J: *Object-Oriented Programming
Press X: Exit
"""
answer = raw_input("\nEnter > ")
answer = answer.lower()
if answer == "a":
lesson1()
elif answer == "x":
sys.exit()
elif answer == "b":
lesson2()
elif answer == "c":
lesson3()
elif answer == "d":
lesson4()
elif answer == "e":
lesson5()
elif answer == "f":
lesson6()
elif answer == "g":
lesson7()
elif answer == "h":
lesson8()
elif answer == "i":
lesson9()
elif answer == "j":
lesson10()
else:
print "oops"
if __name__ == "__main__":
menu()
David Abbott - david at linuxcrazy dot com