config parser -help

Chris Rebert clp2 at rebertia.com
Fri Apr 3 11:08:26 EDT 2009


> On Fri, Apr 3, 2009 at 3:15 PM, Murali kumar <murali.au at gmail.com> wrote:
>>
>> hi all,
>>
>> i want to all my configuration file names in current/user/home directory..
>>
>> for that i came across following function in configparser class..
>> Is it must to specify file names? or only directories enough..
>> if there anyway to read conf filenames in current/user directory...
>>
>> config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')])

2009/4/3 Murali kumar <murali.au at gmail.com>:
> Is there anyway to read all my configuration filenames with extension
> (.cfg)?
>
> Advanced thanks..
>

Not directly, but you can get a list of all such files using
glob.glob() [http://docs.python.org/library/glob.html] and then easily
write such logic yourself from there.

Cheers,
Chris

-- 
I have a blog:
http://blog.rebertia.com



More information about the Python-list mailing list