AndresVargas

Hi!, my nickName is zodman, im a Computer science Engineering. love the FLOSS and FreeSoftware. Python ninja and php coder. On left my love Aisha and me.

Interest links
seen more



Powered by Django.

python break the switch paradigm

Today im want to implement a pownce notes on my blog like jacobian haves.

Im really not use a switch statement on python only put a if else nodes.

So i found how python break the paradigm of switch

def link():
    print "link"
def message( ):
    print "msg"
def event(  ):
    print "event"
def file( ):
    print "juaz"
functions = {
        "link": link(),
        "message":message(),
        "event":event(),
        "file": file()
}   
dofunc = functions["event"]
dofunc()

WTF ?? where is the

switch( var ){
   case "event":
   break;
   default:
   break;
}

Code Python
BACK