Reading config.ini in PythonWin.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vesa Leppanen

    #1

    Reading config.ini in PythonWin.

    Hi,

    I am new in python-list and quite new in Python programming as well. I
    am working mainly with GIS and using Esri's geoprocessing tools.

    I want to use .ini file to set the parameters, especially paths, in my
    project. PythonWin 2.1. is my version.

    Why do I get the default back in the case below? Any way around?

    The Paths,Temp is c:/temp.
    >>win32ui.SetPr ofileFileName(' D:\\config.ini' )
    >>Temp = win32ui.GetProf ileVal('Paths', 'Temp','c:/')
    >>print Temp
    c:/
    >>>
    --

    I saw one old thread but didn't se any solution there.

    W.
  • Gabriel Genellina

    #2
    Re: Reading config.ini in PythonWin.

    At Monday 4/9/2006 15:02, Dennis Lee Bieber wrote:
    However, looking deeper... The same problem seems to be showing up
    >using ConfigParser...
    Odd... specifying a default on the .get() seems to override a
    >default set on the instantiation AND overrides the value IN the file...
    >But the defaults on the instantiation do not override a .get() without
    >defaults.
    Already reported as a bug:
    http://sourceforge.net/tracker/index...70&atid=105470
    I'd suggest using ConfigParser, if possible, rather than the win32ui
    >functions as the former is portable, and does look to have a means of
    >working...
    Just don't use defaults to be safe...


    Gabriel Genellina
    Softlab SRL





    _______________ _______________ _______________ _____
    Preguntá. Respondé. Descubrí.
    Todo lo que querías saber, y lo que ni imaginabas,
    está en Yahoo! Respuestas (Beta).
    ¡Probalo ya!


    Comment

    Working...