Win32All - Services and current path

Discussion in 'Python' started by Jeff Hinrichs, Aug 25, 2003.

  1. 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 'myservice.py 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:
    G:\Python22\lib\site-packages\win32
    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
    file.

    What am I missing?


    -Jeff
    Jeff Hinrichs, Aug 25, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Martin v. =?iso-8859-15?q?L=F6wis?=

    Re: Win32All Crashes Python 2.3?

    Martin v. =?iso-8859-15?q?L=F6wis?=, Aug 5, 2003, in forum: Python
    Replies:
    2
    Views:
    319
    Martin v. =?iso-8859-15?q?L=F6wis?=
    Aug 5, 2003
  2. Mark Hammond

    Re: Win32All Crashes Python 2.3?

    Mark Hammond, Aug 6, 2003, in forum: Python
    Replies:
    2
    Views:
    327
    Roger Upole
    Aug 6, 2003
  3. gcash
    Replies:
    0
    Views:
    484
    gcash
    Aug 7, 2003
  4. Roy H. Berger

    GetEnhMetaFileHeader API and win32all

    Roy H. Berger, Nov 4, 2003, in forum: Python
    Replies:
    0
    Views:
    617
    Roy H. Berger
    Nov 4, 2003
  5. Neil Hodgson
    Replies:
    3
    Views:
    677
    Do Re Mi chel La Si Do
    Aug 28, 2005
Loading...

Share This Page