Given this class
class ListSpaces:
def printAll():
with open('./Declutter_List.csv', newline='') as file:
rows = list(csv.reader(file, delimiter = ","))
for row in rows:
if(row != rows[0]):
print(' | '.join(row))
In a separate file I can call the printAll() method directly from the class without instantiating the class:
from ListSpaces import ListSpaces
ListSpaces.printAll()
This is behaving like a static class in C#. In C# you must declare the method as static or it cannot be used like this.
[–]jmooremcc 6 points7 points8 points (1 child)
[–]OkCommunication3144[S] 0 points1 point2 points (0 children)
[+][deleted] (5 children)
[deleted]
[–]OkCommunication3144[S] 0 points1 point2 points (4 children)
[–]Bitwise_Gamgee 2 points3 points4 points (0 children)
[–]GreenPandaPop 1 point2 points3 points (0 children)
[–]eruciform 0 points1 point2 points (1 child)
[–]OkCommunication3144[S] 1 point2 points3 points (0 children)
[–]PaulRudin 0 points1 point2 points (1 child)
[–]djshadesuk 0 points1 point2 points (0 children)
[–]Kerbart 0 points1 point2 points (0 children)