Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #4041
| From | Oltmans <rolf.oltmans@gmail.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Cannot get past this string related issue |
| Date | 2011-04-26 06:48 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <11f9b43e-3c47-4a68-a7a6-d1880c30fe2d@x8g2000prh.googlegroups.com> (permalink) |
Greetings, I hope you're doing well. I'm stuck in a strange issue,
most likely due to my own ignorance. I'm reading a config file using
ConfigParser module and passing database related info to _mssql.
Following doesn't work
config = ConfigParser.ConfigParser()
config.read('configs.txt')
server_info = config.get("DB_INFO","server")
db = config.get("DB_INFO","database")
username = config.get("DB_INFO","user")
pwd = config.get("DB_INFO","password")
print server_info,db,username,pwd
conn =
_mssql.connect(server=server_info,database=db,user=username,password=pwd)
but following does work
conn =
_mssql.connect(server='server',database='database',user='user',password='password')
Config file looks like following
[DB_INFO]
server = "server"
database = "database"
user = "user"
password = "password"
But I cannot figure out why? Any ideas or help will be highly
appreciated. Thanks!
Back to comp.lang.python | Previous | Next — Next in thread | Find similar
Cannot get past this string related issue Oltmans <rolf.oltmans@gmail.com> - 2011-04-26 06:48 -0700
Re: Cannot get past this string related issue Tim Golden <mail@timgolden.me.uk> - 2011-04-26 14:55 +0100
Re: Cannot get past this string related issue Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-04-26 16:39 +0200
Re: Cannot get past this string related issue Oltmans <rolf.oltmans@gmail.com> - 2011-04-26 08:06 -0700
csiph-web