Say I have an object called obj that is initialized and has 50 member variables. I want to write this to a row in a csv file without having to type out every member variable of the object. The long winded way to do this I want to avoid would be:
writerPosts.writerow([obj.var1, obj.var2, obj.var3 .........................])
I want to do something instead that looks like this and achieves the same result:
writerPosts.writerow(obj)
How can this be done?