[IronPython] INI File For IronPython

Andrew Schaeffer aschaeffer at northps.com
Tue Oct 2 00:09:01 CEST 2007


Use .NET app.config file.

Key-value pair settings can be stored in the <appSettings> section.  For example,

<appSettings>
   <add key="LoginAttempts" value="3" />
</appSettings>

You can access the key-value pair through (depending on which version of .NET you are using) the System.Configuration Namespace.

// .NET 1.x
System.Configuration.ConfigurationSettings.AppSettings["LoginAttempts"];

// .NET 2.0
System.Configuration.ConfigurationManager.AppSettings["LoginAttempts"];

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Davy Mitchell
Sent: Monday, October 01, 2007 5:53 PM
To: Discussion of IronPython
Subject: [IronPython] INI File For IronPython

Hey Folks,

Just wanted to pick a few brains...

I was working on storage for GUI applications using INI files and
CPython libs. I am looking to remove the dependency on Python 2 and do
it all in DotNet. However as far as I can see there is not direct
support for settings files - at least this is what I gather from all
the implementations on the web of various XML/registry solutions none
of which look too polished next to ConfigObj or the Python standard
lib.

How have other people solved this? Just need the basic name/value pair
to sart with.

Thanks,
Davy

--
Davy Mitchell
Blog - http://www.latedecember.co.uk/sites/personal/davy/
Twitter - http://twitter.com/daftspaniel
Skype - daftspaniel
needgod.com
_______________________________________________
Users mailing list
Users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list