Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. Archive.insertdoc(d)
  2. TypeError: insertdoc() missing 1 required positional argument: 'd'
  3.  
  4. doc = Document(name, author, file)
  5. Archive.insertdoc(doc)
  6.  
  7. def __init__(self):
  8. self.listdoc = []
  9.  
  10. def insertdoc(self, d):
  11. self.listdoc.append(d)
  12.  
  13. archive = Archive()
  14.  
  15. doc = Document(name, author, file)
  16. archive.insertdoc(doc)
  17.  
  18. class Archive():
  19. def __init__(self):
  20. self.listdoc = []
  21.  
  22. def insertdoc(self, d):
  23. self.listdoc.append(d)
  24.  
  25. doc = Document(name, author, file)
  26. archive = Archive() # Make an instance of class Archive
  27. archive.insertdoc(doc) # Invoke the insertdoc method of that instance
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement