Re: [Tutor] postgreSQL + psycopg2

2016-05-10 Thread Danny Yoo
On Tue, May 10, 2016 at 10:37 PM, nitin chandra wrote: > Thank you Danny, Alan, > > @ Danny > > I added 'str(formt(line1[0]))' will this do ? Unfortunately, I don't know: what makes me hesitant is the following: * The above is doing something just to line1[0], which looks odd. Why just li

Re: [Tutor] postgreSQL + psycopg2

2016-05-10 Thread nitin chandra
Thank you Danny, Alan, @ Danny I added 'str(formt(line1[0]))' will this do ? @ Alan I did just that nextRow[0] Triple quotes .. there is some part of code in multi-line so... me being just lazyyy ... copy pasted / edited ... and left what is working . just my excuse :P

Re: [Tutor] postgreSQL + psycopg2

2016-05-10 Thread Alan Gauld via Tutor
On 10/05/16 08:33, nitin chandra wrote: > here is the result. > > 1 > ('Supervisor',) > > 1 > Vinayak > Salunke > 1 > > Now I need to remove the braces and quotes .. :) No you don't. Those are just part of the string representation that Python uses when printing a string inside a tuple. If yo

Re: [Tutor] postgreSQL + psycopg2

2016-05-10 Thread Danny Yoo
> here is the result. > > 1 > ('Supervisor',) > > 1 > Vinayak > Salunke > 1 > > Now I need to remove the braces and quotes .. :) By the way, be very careful about generating HTML via naive string concatenation. If you can use a template engine such as Jinja (http://jinja.pocoo.org/), please do

Re: [Tutor] Rate transition from 60hz to 1000hz

2016-05-10 Thread Oscar Benjamin
On 10 May 2016 at 04:08, David Wolfe wrote: > Good Evening; > > I'm collecting both video and force plate data, and I need to be able to > synchronize the two, so I can make some calculations. The video data is at > 60hz, and the force plate data is at 1000hz. I don't want to truncate the > forc

Re: [Tutor] Rate transition from 60hz to 1000hz

2016-05-10 Thread Steven D'Aprano
On Mon, May 09, 2016 at 11:08:37PM -0400, David Wolfe wrote: > Good Evening; > > I'm collecting both video and force plate data, and I need to be able to > synchronize the two, so I can make some calculations. The video data is at > 60hz, and the force plate data is at 1000hz. I don't want to tr

Re: [Tutor] Rate transition from 60hz to 1000hz

2016-05-10 Thread Alan Gauld via Tutor
On 10/05/16 04:08, David Wolfe wrote: > I'm collecting both video and force plate data, and I need to be able to > synchronize the two, so I can make some calculations. The video data is at > 60hz, and the force plate data is at 1000hz. I don't want to truncate the > force plate data. I have no

[Tutor] Rate transition from 60hz to 1000hz

2016-05-10 Thread David Wolfe
Good Evening; I'm collecting both video and force plate data, and I need to be able to synchronize the two, so I can make some calculations. The video data is at 60hz, and the force plate data is at 1000hz. I don't want to truncate the force plate data. So, how do I perform a rate transition (o

Re: [Tutor] is there a better way to do this?

2016-05-10 Thread Chris Roy-Smith
On 10/05/16 07:03, Ondřej Rusek wrote: Dne 9.5.2016 v 10:13 Chris Roy-Smith napsal(a): Hi Python 3.4 Linux (ubuntu) This code does what I want. curs is the result of a mysql query data = [[" " for x in range(9)] for y in range(count)] for (ddate, mood, walk, lag, sleep) in curs: data[

Re: [Tutor] is there a better way to do this?

2016-05-10 Thread Chris Roy-Smith
On 10/05/16 12:01, Steven D'Aprano wrote: On Mon, May 09, 2016 at 06:13:32PM +1000, Chris Roy-Smith wrote: data = [[" " for x in range(9)] for y in range(count)] for (ddate, mood, walk, lag, sleep) in curs: data[row][0]=ddate data[row][1]=mood data[row][2]=walk

Re: [Tutor] postgreSQL + psycopg2

2016-05-10 Thread nitin chandra
IT WORKED THANK YOU SSS MUCH ...phew .. Thank you here is the result. 1 ('Supervisor',) 1 Vinayak Salunke 1 Now I need to remove the braces and quotes .. :) Thank you Nitin On 10 May 2016 at 12:30, Peter Otten <__pete...@web.de> wrote: > nitin chandra wrote: > >> Thanks Alan, Peter

Re: [Tutor] postgreSQL + psycopg2

2016-05-10 Thread Peter Otten
nitin chandra wrote: > Thanks Alan, Peter > > but didn't work > > nextrow=(cursor1.execute(query, (design1,))).fetchone() > AttributeError: 'NoneType' object has no attribute 'fetchone' Try without the method chaining: cursor1.execute(query, (design1,)) nextrow = cursor1.fetchone() __