Created
April 22, 2013 09:14
-
-
Save fliiiix/5433465 to your computer and use it in GitHub Desktop.
A gatto framework Do What The Fuck You Want To Public License
This file contains 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
#!/usr/bin/env python | |
import getpass | |
class Gatto: | |
def sayHey(self): | |
return "Hi my name is Gatto and i LOVE python!" | |
def myPositionInTheCompany(self): | |
return "CEO" | |
def doWork(self): | |
return "Not implemented right now" | |
class GattoCommunicate: | |
def sayHello(self): | |
return "Hello sir." | |
def talkAboutWork(self): | |
return "Yeah, right now i work really hard!" | |
def talkAboutMoney(self): | |
return "I earn a lot of money" | |
class GattoMath: | |
def doHardCalculationWithTwoNumbers(self, x, y): | |
return x + y | |
def doHarderCalculationWithTwoNumbers(self, x, y): | |
return x + y | |
class Parser: | |
def Input(self, arg): | |
g = Gatto() | |
if arg.lower() == "hey": | |
return g.sayHey() | |
if arg == "do work": | |
return g.doWork() | |
if arg == "work": | |
return g.myPositionInTheCompany() | |
if arg == "fefe": | |
return "blog.fefe.de have fun ;)" | |
if arg == "exit": | |
return "cya" | |
return "Well fuck you! This was not a command!" | |
def main(): | |
print("Hey %s you can talk to Gatto with the comamnds [hey, do work,work, exit]" % getpass.getuser()) | |
inp = "" | |
p = Parser() | |
while inp != "Exit": | |
inp = input() | |
print(p.Input(inp)) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment