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


Groups > comp.lang.python > #29368

Re: Batching HTTP requests with httplib (Python 2.7)

Date 2012-09-14 13:46 +0200
From Xavier Combelle <xavier.combelle@free.fr>
Subject Re: Batching HTTP requests with httplib (Python 2.7)
References <k2t90g$4e4$1@speranza.aioe.org> <mailman.659.1347589892.27098.python-list@python.org> <k2uurd$re8$1@speranza.aioe.org> <CA+vVgJUiA-G9=27S6gAu9db3iPBd4dJYD5GMQBJg=A9ZidYW4w@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.826.1347867090.27098.python-list@python.org> (permalink)

Show all headers | View raw


instead of

Le 14/09/2012 12:56, Dwight Hutto a écrit :
> service_num_list = [num for num in range(0,5)]
> for service_num in service_num_list:
> 	eval("web_service_call%i(%i)" % (service_num,service_num))
>
>
service_num_list = [num for num in range(0,5)]
for service_num in service_num_list:
	locals()["web_service_call%i" % (service_num,)](service_num)

would be safer eval is really bad

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


Thread

Batching HTTP requests with httplib (Python 2.7) Chicken McNuggets <chicken@mcnuggets.com> - 2012-09-13 19:34 +0100
  Re: Batching HTTP requests with httplib (Python 2.7) Cameron Simpson <cs@zip.com.au> - 2012-09-14 12:31 +1000
    Re: Batching HTTP requests with httplib (Python 2.7) Chicken McNuggets <chicken@mcnuggets.com> - 2012-09-14 10:53 +0100
      Re: Batching HTTP requests with httplib (Python 2.7) Dwight Hutto <dwightdhutto@gmail.com> - 2012-09-14 06:56 -0400
      Re: Batching HTTP requests with httplib (Python 2.7) Cameron Simpson <cs@zip.com.au> - 2012-09-15 19:30 +1000
      Re: Batching HTTP requests with httplib (Python 2.7) Xavier Combelle <xavier.combelle@free.fr> - 2012-09-14 13:46 +0200
        Re: Batching HTTP requests with httplib (Python 2.7) Neil Cerutti <neilc@norwich.edu> - 2012-09-18 12:40 +0000

csiph-web