[ create a new paste ] login | about

Link: http://codepad.org/YMesk54b    [ raw code | output | fork ]

jkeyes - Python, pasted on Oct 12:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
u_config = u"""[DEFAULT]
tmp: /tmp

[file]
file: %(tmp)s/myfile
"""

import ConfigParser
import StringIO

config = ConfigParser.SafeConfigParser()
config.readfp(StringIO.StringIO(u_config))

print config.get('file', 'file')


Output:
1
/tmp/myfile


Create a new paste based on this one


Comments: