Skip to content Skip to sidebar Skip to footer

How Can I Hook A Function In A Python Module?

So I have a package in my virtual environment installed in the site-packages folder of it. In that package there is a module with a bunch of functions, I want to change one of thes

Solution 1:

You can redefine your function with:

import whatever

def this_is_a_function(parameter):
    pass

whatever.this_is_a_function = this_is_a_function

Post a Comment for "How Can I Hook A Function In A Python Module?"