Win32All - Services and current path

Jeff Hinrichs jlh at
Mon Aug 25 07:17:37 CEST 2003

I'm having trouble nailing down the path to the script directory when
building a service.
I am trying to read in a config file via ConfigParser.  When I run the
service in debug mode all is well.
When I start it up normally, via   ' start' I can't get the
directory where my service lives.

When starting the service normally the current path when I try to read the
file gets set to:
probably because that is where pythonservice lives.  So I can't use
sys.path[0] or parse sys.argv[0]
to find directory where my config file lives.  I don't want to hardcode the
path to the config file but
currently that is the only way I can get the ConfigParser object to find my

What am I missing?


More information about the Python-list mailing list