Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!feeder2.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.094 X-Spam-Evidence: '*H*': 0.81; '*S*': 0.00; 'scripts': 0.09; 'this:': 0.16; 'dictionary': 0.23; 'sender:addr:gmail.com': 0.24; 'shell': 0.24; 'looks': 0.27; 'message-id:@mail.gmail.com': 0.29; "skip:' 10": 0.29; 'there': 0.33; 'file': 0.34; 'to:addr:python-list': 0.35; 'received:209.85.160': 0.36; 'comment': 0.36; 'to:name :python-list': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'received:209.85.160.46': 0.39; 'received :mail-pw0-f46.google.com': 0.39; 'received:209': 0.39; 'to:addr:python.org': 0.40; 'header:Received:6': 0.61 Received-SPF: pass (google.com: domain of jsf80238@gmail.com designates 10.68.225.39 as permitted sender) client-ip=10.68.225.39; Authentication-Results: mr.google.com; spf=pass (google.com: domain of jsf80238@gmail.com designates 10.68.225.39 as permitted sender) smtp.mail=jsf80238@gmail.com; dkim=pass header.i=jsf80238@gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=yB6s6Gyz/jdVNyXB4T7f7vaojWXbJadKITp982rXxuA=; b=snlhL4UiqS36G86p+/trMYctkfjBq+P8ZriU+9pmM6yH1+LKaoy0onqepRhq0JkAFX Ngz7lTXcE2oE2j+MjxNi4y+60nKukOljOVQh61BFXYcaGVhptcHNYFycHFlrWM2LilNm /7XxXShD428NOQ2mWzu90jfcpv5Bja/hgp/QI= MIME-Version: 1.0 Sender: jsf80238@gmail.com Date: Sat, 18 Feb 2012 16:34:38 +0000 X-Google-Sender-Auth: Lnvy0c6cugSxxw1wrGLydUg7yNw Subject: parse a profile From: Jason Friedman To: python-list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1329582882 news.xs4all.nl 6854 [2001:888:2000:d::a6]:54127 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:20588 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', }