I am newbie to python & want to run simple code to create & save HelloWorld.docx here is my code of default.py
asd = os.path.join(os.path.abspath("./"), "lib")
jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asd)
hw = HelloWorld()
hw.main()
And here is my code of init.py()
class HelloWorld:
def __init__(self, dataDir):
self.dataDir = dataDir
def main(self):
"""
: The path to the documents directory. :
"""
Document = jpype.JClass("com.aspose.words.Document")
DocumentBuilder = jpype.JClass("com.aspose.words.DocumentBuilder")
doc = Document()
builder = DocumentBuilder(doc)
builder.writeln('Hello World!')
doc.save(self.dataDir +'HelloWorld.docx')
I am getting this error "TypeError: init() takes exactly 2 arguments (1 given)" I don't know how to fix it, I double check on everywhere but nothing prove helpful