|
From: Rolf K. <r.k...@hc...> - 2008-01-24 19:00:06
|
Fabien NOIRY [Fab...@tm...] wrote:
> I have an application Python 2.4 which works correctly .
> I want to call this applcation with LabView 7.1.
> But when i use code of "PYTHON Symple Execute__ogtk.vi" , i
> succeed to call the main program ( "import sys
> sys.path.append ("Path") import connectCOM") but after the
> main doesn't work . Message Error indicates that there is a
> problem to find the import program. So I tried to strore all
> my program in the same directory. But there is each times defaults.
> So i would like to know if Labpython allows to execute all
> codes Python.
I'm not sure I can understand your problem exactly. In theory everything
that is built into your Python server should work without problems.
As I'm not doing much with Python these days I can't help you with much
experience. From what I can see you probably have a problem that the
"import connectCOM" does not succeed since it can't locate the connectCOM
module.
LabPython does absolutely nothing to setup the actual Python environment
beyond what the Python server does on its own by default. I would guess
that a normal Python command shell would set some paths such as where to
search for modules if they can't be found in builtin, and other such stuff
and that in order for such things to work you will have to do this setup
yourself in your script before trying to use such features.
The reason LabPython does not do these things automatically is that it all
depends on the installed Python server and version thereof and I have tried
to make LabPython as version and distribution agnostic as possible, which
is documented by the fact that you can configure to which Python DLL it
should link.
Maybe that
http://www.python.org/doc/current/inst/search-path.html#SECTION0004100000000
00000000
could be of help to you to see what ways you have to set the search path
correctly.
Also printing out the sys.path into a variable inside LabPython to see what
it is in your setup, might help giving you an idea what you may need to do
differently.
Rolf Kalbermatter
|