Re: [Tutor] How to create a sqlite table schema dynamically

2014-03-20 Thread Alan Gauld
On 20/03/14 22:39, Toni Fuente wrote: I would expect your table to have only 3 columns: week, Name, quantity. You then run your report with something like select name, count from os where week == '15' Aha, and then produce the report in the way, that I am trying to build the table? Week, R

Re: [Tutor] String with literal %s

2014-03-20 Thread Steven D'Aprano
On Thu, Mar 20, 2014 at 04:18:35PM +, Alan Gauld wrote: > On 20/03/14 14:46, Toni Fuente wrote: > > >I am trying to create a string this way: > > > >insertion = "INSERT INTO mytable(week %s) VALUES (\%s, \%s)" % osStringI Don't do this! The world has far too many software vulnerable to code

Re: [Tutor] PLEASE remove me from your e-mailing list

2014-03-20 Thread Emile van Sebille
We can't take you off the list -- see the line below that says: To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor Emile On 3/20/2014 3:43 PM, Art Caton wrote: artca...@gmail.com no longer requests your "Tutor Request" e-mailings ___

Re: [Tutor] PLEASE remove me from your e-mailing list

2014-03-20 Thread Ben Finney
Art Caton writes: > artca...@gmail.com no longer requests your "Tutor Request" e-mailings Every message from the ‘tutor’ mailing list has instructions at the bottom for unsubscribing. We, fellow members, cannot do it for you. -- \ “There's no excuse to be bored. Sad, yes. Angry,

Re: [Tutor] PLEASE remove me from your e-mailing list

2014-03-20 Thread Toni Fuente
* Art Caton [2014-03-20 18:43:02 -0400]: > Date: Thu, 20 Mar 2014 18:43:02 -0400 > From: Art Caton > To: Tutor@python.org > Subject: [Tutor] PLEASE remove me from your e-mailing list > Message-ID: > > > artca...@gmail.com no longer requests your "Tutor Request" e-mailings >

[Tutor] PLEASE remove me from your e-mailing list

2014-03-20 Thread Art Caton
artca...@gmail.com no longer requests your "Tutor Request" e-mailings ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to create a sqlite table schema dynamically

2014-03-20 Thread Toni Fuente
* Alan Gauld [2014-03-20 19:27:57 +]: > On 20/03/14 17:31, Toni Fuente wrote: > > >I got a database from where I get the data that I am going to process, > >and create a dictionary osDict. This dictionary has the form of: > > > >osDict = {'CentOS v4.x': 10, 'Linux OS': 5, 'Redhat Enterprise

Re: [Tutor] How to create a sqlite table schema dynamically

2014-03-20 Thread Peter Otten
Alan Gauld wrote: > I confess I'm still not clear on your schema. What should the populated > table(s) look like? It all feels very un-SQL like to me. I'll make a bold guess that he wants to make a pivot table, something that is indeed not supported by sqlite. E. g., start with week | os

Re: [Tutor] How to create a sqlite table schema dynamically

2014-03-20 Thread Alan Gauld
On 20/03/14 17:31, Toni Fuente wrote: I got a database from where I get the data that I am going to process, and create a dictionary osDict. This dictionary has the form of: osDict = {'CentOS v4.x': 10, 'Linux OS': 5, 'Redhat Enterprise 4': 7} I want to create a weekly report in form of a csv

Re: [Tutor] String with literal %s

2014-03-20 Thread Toni Fuente
* Alan Gauld [2014-03-20 16:18:35 +]: > On 20/03/14 14:46, Toni Fuente wrote: > > >I am trying to create a string this way: > > > >insertion = "INSERT INTO mytable(week %s) VALUES (\%s, \%s)" % osStringI > > > >not enough arguments for format string > > > >Where the first %s is going to be s

Re: [Tutor] String with literal %s

2014-03-20 Thread Toni Fuente
* Alex Kleider [2014-03-20 09:02:41 -0700]: > On 2014-03-20 07:46, Toni Fuente wrote: > >Hi again, > > > >I am trying to create a string this way: > > > >insertion = "INSERT INTO mytable(week %s) VALUES (\%s, \%s)" % > >osStringI > > > >not enough arguments for format string > > > >Where the firs

Re: [Tutor] How to create a sqlite table schema dynamically

2014-03-20 Thread Toni Fuente
* bob gailer [2014-03-20 11:38:47 -0400]: > On 3/19/2014 8:19 AM, Toni Fuente wrote: > >Hello everyone, > > > >I am stack with a problem that I can't find a solution: > > > >I need to create a sqlite schema dynamically, I've got a dictionary with > >text keys: "RedHat", "CentOS", "SLES9",..., "et

Re: [Tutor] String with literal %s

2014-03-20 Thread Alan Gauld
On 20/03/14 14:46, Toni Fuente wrote: I am trying to create a string this way: insertion = "INSERT INTO mytable(week %s) VALUES (\%s, \%s)" % osStringI not enough arguments for format string Where the first %s is going to be substitute by the variable osStringI, but the other two VALUES (\%s,

Re: [Tutor] String with literal %s

2014-03-20 Thread Alex Kleider
On 2014-03-20 07:46, Toni Fuente wrote: Hi again, I am trying to create a string this way: insertion = "INSERT INTO mytable(week %s) VALUES (\%s, \%s)" % osStringI not enough arguments for format string Where the first %s is going to be substitute by the variable osStringI, but the other tw

Re: [Tutor] How to create a sqlite table schema dynamically

2014-03-20 Thread bob gailer
On 3/19/2014 8:19 AM, Toni Fuente wrote: Hello everyone, I am stack with a problem that I can't find a solution: I need to create a sqlite schema dynamically, I've got a dictionary with text keys: "RedHat", "CentOS", "SLES9",..., "etc", "etc" My intention was at the time of creating the table

[Tutor] String with literal %s

2014-03-20 Thread Toni Fuente
Hi again, I am trying to create a string this way: insertion = "INSERT INTO mytable(week %s) VALUES (\%s, \%s)" % osStringI not enough arguments for format string Where the first %s is going to be substitute by the variable osStringI, but the other two VALUES (\%s, \%s), should be created as li

Re: [Tutor] How to create a sqlite table schema dynamically

2014-03-20 Thread Toni Fuente
* Mark Lawrence [2014-03-19 15:54:27 +]: > On 19/03/2014 12:19, Toni Fuente wrote: > >Hello everyone, > > > >I am stack with a problem that I can't find a solution: > > > >I need to create a sqlite schema dynamically, I've got a dictionary with > >text keys: "RedHat", "CentOS", "SLES9",..., "