Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!18g2000prd.googlegroups.com!not-for-mail From: Oltmans Newsgroups: comp.lang.python Subject: Re: Cannot get past this string related issue Date: Tue, 26 Apr 2011 08:06:16 -0700 (PDT) Organization: http://groups.google.com Lines: 55 Message-ID: <982de857-b883-47f3-a962-0e3b60280c8e@18g2000prd.googlegroups.com> References: <11f9b43e-3c47-4a68-a7a6-d1880c30fe2d@x8g2000prh.googlegroups.com> NNTP-Posting-Host: 175.110.120.23 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1303830377 12426 127.0.0.1 (26 Apr 2011 15:06:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 26 Apr 2011 15:06:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 18g2000prd.googlegroups.com; posting-host=175.110.120.23; posting-account=gYw1wwoAAAAjy75GZEtv7OQ7S8CI3WRQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16,gzip(gfe) Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:4046 On Apr 26, 7:39=A0pm, Thomas Rachel wrote: > Am 26.04.2011 15:48, schrieb Oltmans: > > > > > > > > > > > Following doesn't work > > > config =3D ConfigParser.ConfigParser() > > config.read('configs.txt') > > server_info =3D config.get("DB_INFO","server") > > db =3D config.get("DB_INFO","database") > > username =3D config.get("DB_INFO","user") > > pwd =3D config.get("DB_INFO","password") > > print server_info,db,username,pwd > > conn =3D > > _mssql.connect(server=3Dserver_info,database=3Ddb,user=3Dusername,passw= ord=3Dpwd) > > > but following does work > > > conn =3D > > _mssql.connect(server=3D'server',database=3D'database',user=3D'user',pa= ssword=3D'pa ssword') > > Ok, if you are this far: what prevents you from trying > > print server_info, db, username, pwd > > and being aware that IF there are " around, they are not part of the > string representation, but they are really there. > > > Config file looks like following > > > [DB_INFO] > > server =3D "server" > > database =3D "database" > > user =3D "user" > > password =3D "password" > > I think if you will have seen the output above, you will probably see > what is wrong here: too many "s. :-) Many thanks, really appreciate help. > > HTH & HAND! > > Thomas