import sys
list = ['ss', 1,1999, 'aa', 2, 2000, 'cd',4,2110]
def inputData():
inputdata= 'y'
while(inputdata== 'y'):
gear_name = input('gear name : ')
list.append( gear_name )
gear_number = input("gear number: ")
list.append( gear_number )
product_date = input("production date(ex:1990-01-01): ")
list.append( product_date )
inputdata = input(" Are you input data(y/n)? ")
return 0
def outputData():
print "-----------------------------------------"
print " gear name number production date "
print "-----------------------------------------"
start_pos=0
end_pos=len(list)
div = 3
for i in range(start_pos,end_pos+div,div):
out=list[start_pos:start_pos+div]
if out!=[]:
print(out)
start_pos = start_pos + div
def searchData():
w_data=input("Input data you want to search: ")
div = 3
start_pos = 0
start_pos=list.index(w_data)
print start_pos
out=list[start_pos:start_pos+div]
print "-----------------------------------------"
print " gear name number production date "
print "-----------------------------------------"
if out!=[]:
print(out)
return 0
def print_menu():
print "1. Input"
print "2. Output"
print "3. Searche"
print "4. Exit"
loop=True
while loop:
print_menu()
choice = input("Enter your choice[1-4] : ")
if choice == 1:
print "1.Input Menu has been selected"
inputData()
elif choice == 2:
print "2.Output Menu has been selected"
outputData()
elif choice == 3:
print "3.Searche Menu has been selected"
searchData()
elif choice == 4:
print "4.Exit Menu has been selected"
else:
print "Wrong number has been selected!!"
loop=False
'python > python basic' 카테고리의 다른 글
python programming (0) | 2018.11.12 |
---|---|
[python][serial]serial port list (0) | 2018.11.12 |
[python][cv2]ImportError:No module named cv2 (0) | 2018.11.12 |
[python]SyntaxError:Non-ASCII charater '\xec' (0) | 2018.11.12 |
[python]PyQt install (0) | 2018.11.10 |