I want to use a class in Python to simulate a 'struct' in C++. Also, I need it in global form as I am using it in many functions and I do not want to pass parameters.
How do I do this(create global objects of a class).
My attempt was :
class MyClass():
//Class Constuctor
global ob1 = Myclass()
def func1():
ob1.name = "Hello World"
def func2():
print(ob1.name)
func1()
func2()
This gives me an 'Invalid Syntax' error, how did I go wrong, or is there a more efficient method to do this? Note that I have like 10 values, so the class is going to be a pain anyway.