[Tutor] Django REST API Question

2017-03-14 Thread Sreenathan Nair
Hi, I am trying to setup a django REST based service, following is my setup: MySQL DB Table (Inventory) contents is retrieved by a Django REST API query and finally passed as a list of dictionaries to a python code which will then implement some business logic based on this list. The working requ

Re: [Tutor] cx_Oracle and Pyinstaller

2017-03-14 Thread Alan Gauld via Tutor
On 14/03/17 14:29, Madhu Venkat wrote: > try: > Conn = cx_Oracle.connect (self.dsn) > except cx_Oracle.DatabaseError as exception: > > dsn has all the required connection info. > > In this case, I believe I don't need TNSnames.ora file, please confirm. I don't know a

Re: [Tutor] cx_Oracle and Pyinstaller

2017-03-14 Thread Madhu Venkat
Reg: https://mail.python.org/pipermail/tutor/2014-December/103608.html Hi, I am connecting to Oracle little differently, not using TNSnames.ORA file. Here is a line of code to show how I am connecting. def connect(self): try: Conn = cx_Oracle.connect (self.dsn) e

Re: [Tutor] While until the end of a list

2017-03-14 Thread Toni Fuente via Tutor
> > for item in itertools.chain.from_iterable(chunk): >... > > will work, too, without the consumption of time and memory needed to build > the list. > Thank you Peter, yes it works as I wanted like that. ___ Tutor maillist - Tutor@python.org T

Re: [Tutor] While until the end of a list

2017-03-14 Thread Peter Otten
Toni Fuente via Tutor wrote: > strings_chunk = list(itertools.chain.from_iterable(chunk)) > for item in strings_chunk: ... Note that if you are iterating over strings_chunk just once there is no need to create an in-memory list. for item in itertools.chain.from_iterable(chunk):

Re: [Tutor] While until the end of a list

2017-03-14 Thread Toni Fuente via Tutor
* Peter Otten <__pete...@web.de> [2017-03-13 19:57:38 +0100]: > > Toni Fuente via Tutor wrote: > > > Hi, > > > > I've got this script that goes through an httpd conf file, and gets the > > related bits of it for a site, and writes a new config with values that > > I am interested. The problem is

Re: [Tutor] Where am I mistaken? (exec not working as I expect)

2017-03-14 Thread Peter Otten
Steven D'Aprano wrote: > Hello Francesco, and welcome! > > My comments below. > > On Sun, Mar 12, 2017 at 11:48:35PM +0100, Francesco Loffredo via Tutor > wrote: > >> I did only find a way to access the current document, but that's >> all. Armed with that, and hoping to find some field names, I