[python-win32] eggs and pythonservices

Norm Petterson njp at njp.us
Mon Mar 12 22:31:31 CET 2007


On 3/12/07, jose at cybergalvez.com <jose at cybergalvez.com> wrote:
>
> Dear win32 experts
>
> I am trying to write a win32 service for a paste/pylons application
> which works well from the command line, however if I try to make it
> into a service the application can no longer find "eggs" that it needs.
> I'm including the command line program (which works) and the winservice
> (which noes not work) hopping that someone can point me the right
> direction.  One that that I'm doing to complicate things is the eggs it
> needs to find are not installed in the usual place, which for the
> command line program simply means manipulating sys.path, however doing
> the same thing for the windows service does not have the same result.
>
> Any and all help is appreciated



I usually put something like:

os.chdir(os.path.abspath(os.path.dirname(__file__)))

in the initialization of my service and reference other files (like config
files and log files) by relative directory locations:

opts = LoadConfig('../conf/server.cfg')       # Fetch server options

This works on any platform I use (win32 service or linux daemon).

HTH,

Norm

_______________________________________________

> Python-win32 mailing list
> Python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20070312/9ae525a8/attachment.htm 


More information about the Python-win32 mailing list