Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--003-ConfigParser/config.ini3
-rwxr-xr-x003-ConfigParser/example.py13
2 files changed, 16 insertions, 0 deletions
diff --git a/003-ConfigParser/config.ini b/003-ConfigParser/config.ini
new file mode 100644
index 0000000..8b7530e
--- /dev/null
+++ b/003-ConfigParser/config.ini
@@ -0,0 +1,3 @@
+[person]
+name = tch
+lastname = sugarlabs
diff --git a/003-ConfigParser/example.py b/003-ConfigParser/example.py
new file mode 100755
index 0000000..c1f687a
--- /dev/null
+++ b/003-ConfigParser/example.py
@@ -0,0 +1,13 @@
+#!/usr/bin/python
+
+from ConfigParser import SafeConfigParser
+
+
+def main():
+ parser = SafeConfigParser()
+ parser.read('config.ini')
+
+ print parser.get('person', 'name')
+
+if __name__ == "__main__":
+ main()