I'm having trouble appending to an existing function.
def functionA(self):
var1 = hi
var2 = bye
Class A(object):
def functionB(self)
var1 = hi <-- insert functionA here
var2 = bye
var3 = "something not in functionA"
Sorry I know this is probably basic, but I can't find this anywhere. The closest I've found is here Python add to a function dynamically . Thanks in advance for your help!
asked Oct 21, 2013 at 0:48
mrmo123
7251 gold badge8 silver badges24 bronze badges
1 Answer 1
def functionA():
var1 = hi
var2 = bye
return (var1, var2)
class A(object):
def functionB(self):
var1, var2 = functionA()
var3 = "something not in functionA"
how about that?
Sign up to request clarification or add additional context in comments.
1 Comment
mrmo123
thanks! I wasn't expecting an answer like this, but it works for my application!
lang-py
functionA()fromfunctionB()?