| View previous topic :: View next topic |
| Author |
Message |
Satsuki General User

Joined: 28 Oct 2009 Posts: 11
|
Posted: Wed Oct 28, 2009 3:52 pm Post subject: Macro and python |
|
|
| I have a macro and I need linker with external python code. ¿It is possible? |
|
| Back to top |
|
 |
QuazzieEvil Super User

Joined: 17 Jan 2007 Posts: 599 Location: Houston, TX
|
Posted: Thu Oct 29, 2009 4:54 am Post subject: |
|
|
does the code have anything to do with python/pyUNO? or just good ol' python?
If just a regular python module you are trying to execute, you can use the Shell(...) command to execute it (assumption is that you are using OOo Basic).
example:
| Code: |
python="C:\Python23\python.exe" 'SOME PYTHON LOCATION
myMod="some_mod.py"
cmd=python & " " & myMod
Shell(cmd)
|
_________________ Free Docs @ http://www.baseprogramming.com/resources.html
Book @ lulu.com http://www.lulu.com/content/2455551 |
|
| Back to top |
|
 |
Satsuki General User

Joined: 28 Oct 2009 Posts: 11
|
Posted: Thu Oct 29, 2009 11:34 am Post subject: |
|
|
The code doesn't haven anything to do with python/pyUNO
I created a client and server in python. A server receive a parameter, make a consult to google research and retrieve the result to client.
Now, I have send info from openoffice to server. The problem is make socket in openoffice, so I think program anythings using OOo basic and then send a parameter to python client (client.py isn't part of openoffice).
¿Can I do this?
I program in Ubuntu.
Thanks |
|
| Back to top |
|
 |
Satsuki General User

Joined: 28 Oct 2009 Posts: 11
|
Posted: Tue Nov 03, 2009 8:16 am Post subject: |
|
|
| ¿And the code to Ubuntu? |
|
| Back to top |
|
 |
dickkniep General User

Joined: 01 Mar 2004 Posts: 29
|
Posted: Wed Nov 04, 2009 3:09 am Post subject: Pyuno under Ubuntu |
|
|
This is quite easy. The good guys of Ubuntu have compiled python against the same libs as OO. Consequently you can just use the system Python in you pyuno code.
So if you want to execute an external python module, just import the module and execute as you are used to do |
|
| Back to top |
|
 |
Satsuki General User

Joined: 28 Oct 2009 Posts: 11
|
Posted: Thu Nov 05, 2009 2:41 pm Post subject: |
|
|
¿Any example to import the module and execute?
I use macro basic and module or script python. |
|
| Back to top |
|
 |
|