Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. class YobaCmd:
  2.     def __init__(self, cmd):
  3.         self.cmd = cmd
  4.  
  5.     def function1(self):
  6.         return self.execute()
  7.  
  8.     def function2(self, count):
  9.         return self.execute(count)
  10.  
  11.     def execute(self, *args, **kwargs):
  12.         print(self.cmd)
  13.         count = args[0] if len(args) else 0
  14.         print(count)
  15.  
  16. yc = YobaCmd('svarit_pelmeshki')
  17. yc.execute()
  18. yc = YobaCmd('skushat_pelmeshku')
  19. yc.execute(5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement