How could I implement a virtual method and override it in python?

wesley.keeling at iugome.com wesley.keeling at iugome.com
Wed Sep 14 18:16:12 EDT 2016


Hey guys, I will show the code first:

Helper.py:

def Foo( *args ):
	print ("This is a callback")

def Run:
    Foo()


MyModule.py:

import Helper

def Foo( *args ):
	print ("I want to be the new callback")



I want to be able to call the Foo method in MyModule.py when it's there first and when it's not I want to call the Foo in helper.py. 

I am coming from .net so I am not fully understanding how the Foo method would override the other one. 

Thanks! 



More information about the Python-list mailing list