Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # define your functions
- # then
- def myfuncSwitch(arg):
- cmd = arg[1]
- switcher = {
- "create": createDB,
- "addpass": addPass,
- "all": getAll,
- "authenticate": authenticate,
- "getlistname": getPlayListName,
- "getlists": getPlayLists,
- "get": get,
- "set": set,
- "add": addFile,
- "addtitle": addTitle,
- "addtolist": addFileToList,
- "remove": removeFile,
- "getnfiles": getCount,
- "search": search,
- "addlist": addList,
- "delete": deleteFile,
- "isremoved": isRemoved,
- }
- func = switcher.get(cmd)
- func(*arg[2:])
- def main():
- myfuncSwitch(sys.argv)
- if __name__ == "__main__":
- main()
- # call your script like : $ myscript.py delete arg1 arg2 ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement