Category : class

I’ve here this function named search inside my class: def search_prototype1(self, word, column): for rowIndex in range(self.tableWidget.rowCount()): item = self.tableWidget.item(rowIndex, column) if item is not None: if word in item.text(): self.tableWidget.setCurrentCell(rowIndex, 2) What this function does is to search a certain column in a Table widget and highlight it. But Since I need to use ..

Read more

Program: class Pets: animals = [] def init(self, animals): self.animals = animals def walk(self): for animal in self.animals: print(animal.walk()) class Cat: is_lazy = True def init(self, name, age): self.name = name self.age = age def walk(self): return f'{self.name} is just walking around’ class Simon(Cat): def sing(self, sounds): return f'{sounds}’ class Sally(Cat): def sing(self, sounds): return ..

Read more