J
Josh Close
Is there a way to call a class method without an instance of that class?
class myClass:
def printSomething(message):
print message
myClass.print()
That's basically what I want to do. Is there a way to do that without
having to do
c = myClass()
c.print()
I've tried using
class myClass:
def printSomething(message):
print message
printSomething = staticmethod(printSomething)
but that didn't seem to work either. I'm probably just missing
something really simple here.
-Josh
class myClass:
def printSomething(message):
print message
myClass.print()
That's basically what I want to do. Is there a way to do that without
having to do
c = myClass()
c.print()
I've tried using
class myClass:
def printSomething(message):
print message
printSomething = staticmethod(printSomething)
but that didn't seem to work either. I'm probably just missing
something really simple here.
-Josh