I'm programming a script with Python using instances of FileHandler
class but the second overwrites the first even without being assigned to the same variables.
The class:
class FileHandler():
name = None
path = None
@classmethod
def __init__(self,name,path):
self.name=name
self.path=path
@classmethod
def getName(self):
return self.name
@classmethod
def getPath(self):
return self.path
The script:
import fileHandler
origen=fileHandler.FileHandler('a','b')
destino=fileHandler.FileHandler('c','d')
print origen.getName(),origen.getPath()
print destino.getName(),destino.getPath()
The result:
c d
c d