Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def choose():
- FILE_PATH = '/home/codecool/Pulpit/PythonMK/lightweight-erp-python-isem/hr/persons.csv'
- inputs = ui.get_inputs(["Please enter a number: "], "")
- option = inputs[0]
- table = data_manager.get_table_from_file(FILE_PATH)
- if option == "1":
- show_table(table)
- if option == "2":
- show_table(table)
- table = add(table)
- if option == "3":
- show_table(table)
- id = ui.get_inputs(["Please enter id: "], "")
- remove(table, id)
- if option == "4":
- id = ui.get_inputs(["Please enter ID to update"], "")
- table = update(table,id)
- show_table(table)
- sys.exit()
- if option == "0":
- return False
- for i in range(len(table)):
- rec = table[i]
- if id_[0] == rec[0]:
- list_of_labels = ['Enter ID','Enter Name','Enter Year']
- title = 'Update a record with ID = %s' % id_[0]
- rec = ui.get_inputs(list_of_labels,title)
- table[i] = rec
- return table
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement