I have the following python class working and i want to create a command line interface for the user to use. I came across docopt and thought it was a good idea to use. I haven't come across a tutorial or documentation showing how to integrate docopt to your python classes all i get is just small functions . Is it possible? A link with helpful infromation would help me out or just a small snippet to help me work out my way would be very helpful.
class Bootcamp(object):
tasks = {1: "TDD", 2: "OOP", 3: "Programming Logic", 4:
"Version Control", 5: "Agile Methodology",
6: "Growth Mindset", 7: "Asking Questions", 8:
"Motivation and Commitment", 9: "Speaking"}
def __init__(self, name, tasks=tasks):
self.name = name
self.tasks = tasks
self.completed = []
self.incompleted = tasks.values()
def add_completed_items(self, i):
if i in self.tasks.keys():
self.completed.append(self.tasks[i])
self.incompleted.remove(self.tasks[i])
return "tasks added to complete"
else:
return "not in the tasks"
def check_progress(self):
self.progress = float(len(self.completed)) / \
float(len(self.tasks)) * 100
return int(self.progress)