Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #20588 > unrolled thread
| Started by | Jason Friedman <jason@powerpull.net> |
|---|---|
| First post | 2012-02-18 16:34 +0000 |
| Last post | 2012-02-18 16:34 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
parse a profile Jason Friedman <jason@powerpull.net> - 2012-02-18 16:34 +0000
| From | Jason Friedman <jason@powerpull.net> |
|---|---|
| Date | 2012-02-18 16:34 +0000 |
| Subject | parse a profile |
| Message-ID | <mailman.5940.1329582882.27778.python-list@python.org> |
I have a file I use for shell scripts that looks like this:
export VAR1=/path/to/dir
export VAR2=7
export VAR3=${VAR1}/further/path
# comment
. /another/file
And a file /another/file:
export VAR4=database-name
Is there an existing package that will read such a file and return a
dictionary like this:
{
'VAR1': '/path/to/dir',
'VAR2': 7,
'VAR3': '/path/to/dir/further/path',
'VAR4': 'database-name',
}
Back to top | Article view | comp.lang.python
csiph-web