Is there a way to import a module inside a function, then use it outside that function? I'm assuming the issue is that the import name is local and not global. I don't know how to fix it.
sample code:
def func1():
    import modshare
    modshare.ken=2
    print("func1")
    func2()
def func2():
    print("func2")
    # Error here modshare undefined 
    modshare.ken = 2
func1()
 
     
     
    