Last active
December 16, 2015 19:50
-
-
Save timtan/5488222 to your computer and use it in GitHub Desktop.
please fill in addData and show Data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import shelve | |
| def addData(data): | |
| #figure how to add data | |
| pass | |
| def showData(data): | |
| # display your organized data | |
| pass | |
| init_data = shelve.open('sample.db') | |
| ## Check the init_ata is well organized, or you need to organized by yourself | |
| print "commands ? press A to add a name, press L to list all names" | |
| print ">", | |
| command = raw_input() | |
| if command == 'A': | |
| print "data to add is: " | |
| addData(init_data) | |
| elif command == 'L': | |
| showData(init_data) | |
| print "-- end of data --" | |
| else: | |
| print 'you should press A or L' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment