From f45712a94e41a9362bcb44ea4b84f52c95a55907 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Sat, 24 Jul 2010 09:54:38 -0500 Subject: [PATCH] test loading from a config file --- dr.botzo.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 dr.botzo.py diff --git a/dr.botzo.py b/dr.botzo.py new file mode 100755 index 0000000..6676611 --- /dev/null +++ b/dr.botzo.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3.1 + +import configparser +import os + +config = configparser.ConfigParser() +config.read([os.path.expanduser('~/.dr.botzo.cfg'), 'dr.botzo.cfg']) + +# load connection info +server = config.get('IRC', 'server') +port = config.getint('IRC', 'port') +channel = config.get('IRC', 'channel') +nick = config.get('IRC', 'nick') +name = config.get('IRC', 'name') + +print(server + " " + str(port) + " " + channel + " " + nick + " " + name) + +# vi:tabstop=4:expandtab:autoindent