I am doing a course project based on Python and I am curious if there is a way to write something similar to this (written in C++) in python. I am struggling to write this in Python (transfer information from text file into the set/getters of a class I have already created.
while (file >> Code >> Name >> Description >> Price >> Quantity >> color >>
Size >> BasketballRate) {
Basketball* object3 = new Basketball();
object3->SetName(Name);
object3->SetCode(Code);
object3->SetDescript(Description);
object3->SetPrice(Price);
object3->SetQuantity(Quantity);
object3->setColor(color);
object3->setSize(Size);
object3->setBasketballRate(BasketballRate);
basketball.push_back(object3);
}
file.close();