Hello everyboby,
I'm trying to create an .odt document just using python, and the API uno (available with the standard distribution of Apache Open Office). But, I'm completely stuck for the moment, and this main goal seems to be still a long way to go...
For information, I'm using a mac os x 10.9.5 computer, and my Apacha Open Office version is the 4.1.1
Let me explain what I have done, and where I'm currently stuck:
- First of all, I've opened a terminal to launch OpenOffice, with the following:
First of all, I've opened a terminal to launch OpenOffice, with the following:
I have to confess that I've found this on the web and do not really understand what the second line is doing... Probably, it's because I do not know what the file soffice.bin contains... For me, it opens a socket in order to communicate with OpenOffice. Am I write? If you can explain me precisely this, I would be wonderful actually!
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
2$ cd ../../Applications/OpenOffice.app/Contents/MacOS/ $ ./soffice.bin -headless -nofirststartwizard -accept="uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager"
- Secondly, I open an other terminal, go in the same folder than in the first terminal, then launch python, import the uno package and declare a class whose goal is to create OpenOffice easily. Here is the code:
Once again, I don't understand all the detail of this code and would not have been able to code it myself...I think that it's like a client, the other terminal being the server. The line "self.smgr = ..." should be here to try to "connect" to the "server socket", or something like that...
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
2
3
4
5
6
7
8
9
10
11
12
13
- Finally, I'm trying to declare a UnoClient objet by
Of course, it would have been too simple if this code would have be correct... Python answer me
Code : Sélectionner tout - Visualiser dans une fenêtre à part unoClient = UnoClient()
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
2
3
4
Does anyone has some ideas, advices or references to understand what I am doing?
Thanks very much for all your answer,
Tolliob

 

 
		
		 
        

 
			
			


 
   
 


 Create an open office document with python
 Create an open office document with python
				 Répondre avec citation
  Répondre avec citation
Partager