There is a separate module XMLValidator.py with the same class in the next folder. I import it and use the module. On Windows, the following code worked without problems:
from libraries.XMLValidator import XMLValidator #... XMLValidator.validate_xml(xml_schema_file, xsd_schema_file) In Linux, the error began to fall:
unbound method validate_xml () must be called with XMLValidator instance as first argument (got str instance instead)
Apparently, the solution would be to create an instance of the class and pull a function out of it (well, or make it static).
sys.path.insert(0, './libraries') from XMLValidator import XMLValidator #... XMLValidator1 = XMLValidator() XMLValidator1.validate_xml(xml_schema_file, xsd_schema_file) But in this case the error falls:
Traceback (most recent call last): File "install.py", line 176, in XMLValidator1.validate_xml (xml_schema_file, xsd_schema_file)
TypeError: validate_xml () takes exactly 2 arguments (3 given)
How to be? Probably, I do not correctly understand the meaning of the first error.