Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #4046

Re: Cannot get past this string related issue

From Oltmans <rolf.oltmans@gmail.com>
Newsgroups comp.lang.python
Subject Re: Cannot get past this string related issue
Date 2011-04-26 08:06 -0700
Organization http://groups.google.com
Message-ID <982de857-b883-47f3-a962-0e3b60280c8e@18g2000prd.googlegroups.com> (permalink)
References <11f9b43e-3c47-4a68-a7a6-d1880c30fe2d@x8g2000prh.googlegroups.com> <ip6lek$19g$1@r03.glglgl.eu>

Show all headers | View raw


On Apr 26, 7:39 pm, Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-
a470-7603bd3aa...@spamschutz.glglgl.de> wrote:
> Am 26.04.2011 15:48, schrieb Oltmans:
>
>
>
>
>
>
>
>
>
> > 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='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 = "server"
> > database = "database"
> > user = "user"
> > password = "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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar


Thread

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