Re: [Tutor] MySQLdb question

2006-04-14 Thread Liam Clarke
On 4/15/06, Patty <[EMAIL PROTECTED]> wrote: > Hi, > > I have a data structure in a python file that looks something like this: > > my_map= { "host1": {"target1", "target2", "target3" }, >"host2": {"target4", "target5", "target6" }, > } > > I have a method that has two parame

Re: [Tutor] changing 2x3 matrix to 3x2 matrix - using lists

2006-04-14 Thread Kent Johnson
Srinivas Iyyer wrote: > Dear group, > I have a huge list of data. This was obtained using R > through Rpy. > > the data resembles a 10K (row) x 30 (column) matrix. > > I processed the data column wise( obtained median > values for duplicated rows). > > Now I am left with 500 rows and 30 colu

Re: [Tutor] plz help

2006-04-14 Thread Adam
On 14/04/06, John Brokaw <[EMAIL PROTECTED]> wrote: > Adam, Yes i have and thanks for trying to help. I guess I need to be more > specific with my question. I need to know why this is happening and will it > happend if a put together a complete game. I can close the window with the > display.quit c

[Tutor] changing 2x3 matrix to 3x2 matrix - using lists

2006-04-14 Thread Srinivas Iyyer
Dear group, I have a huge list of data. This was obtained using R through Rpy. the data resembles a 10K (row) x 30 (column) matrix. I processed the data column wise( obtained median values for duplicated rows). Now I am left with 500 rows and 30 columns. I want to print the same way. A

Re: [Tutor] plz help

2006-04-14 Thread Adam
> John Brokaw <[EMAIL PROTECTED]> wrote: > Date: Thu, 13 Apr 2006 13:07:23 -0400 > From: "John Brokaw" <[EMAIL PROTECTED]> > To: "David Holland" <[EMAIL PROTECTED]> > Subject: Re: Show us some code > > > Sure... > >>> import pygame, sys,os > >>> from pygame.locals import * > >>> pygame.init() > (6

Re: [Tutor] Meaning of %g ?

2006-04-14 Thread Alan Gauld
>>> Hopefully those examples show whats happening. >>> I have no idea why %g is dropping a digit, it may even be a bug! >> >> It looks to me like either a documentation error or a bug. It might be >> worth asking on c.l.py. > > Which I did; see here for Fredrik Lundh's answer: > http://groups.goog

Re: [Tutor] MySQLdb question

2006-04-14 Thread Patty
> > for ahost,target in my_map: > cursor.execute("""SELECT %s FROM targets > WHERE target_name in (%s) """ % (ahost, ",".join(target))) > Hi again, I'm confused :-( I'm using an old version of python (2.3.4). In my database, target_name is the name of a column, not the name of

Re: [Tutor] Meaning of %g ?

2006-04-14 Thread Kent Johnson
Kent Johnson wrote: > Alan Gauld wrote: > print "%14.3g\n%14.3e\n%14.3f" % (bignum,bignum,bignum) >> 1.23e+009 >> 1.235e+009 >> 1234567898.235 >> >> Hopefully those examples show whats happening. >> I have no idea why %g is dropping a digit, it may even be a bug! > > It looks to me li

Re: [Tutor] Looking for an open source project

2006-04-14 Thread Dave S
On Friday 14 April 2006 11:07, Kent Johnson wrote: > Dave S wrote: > > Hi all, > > > > I have been playing around with Python for a while now and am looking > > for open source KDE projects written in Python that I can help with / > > learn from. > > > > Something relatively simple that uses Qt. (

Re: [Tutor] MySQLdb question

2006-04-14 Thread Allen John Schmidt, Jr.
Patty wrote: >I have a data structure in a python file that looks something like this: > >my_map= { "host1": {"target1", "target2", "target3" }, > "host2": {"target4", "target5", "target6" }, > } > >cursor.execute("""SELECT %s FROM targets >WHERE target_name = %s """ %

Re: [Tutor] MySQLdb question

2006-04-14 Thread Pujo Aji
I think you can wrap the select sql command with a function which return a string.this function receive a particular hostname in a string format and return the whole 'SELECT ... FROM.. WHERE' style including the hostname from the function argument. Cheers,pujoOn 4/14/06, Patty <[EMAIL PROTECTED]> w

[Tutor] MySQLdb question

2006-04-14 Thread Patty
Hi, I have a data structure in a python file that looks something like this: my_map= { "host1": {"target1", "target2", "target3" }, "host2": {"target4", "target5", "target6" }, } I have a method that has two parameteres (ahost, atarget), which I want to use to retrieve dat

Re: [Tutor] Looking for an open source project

2006-04-14 Thread Kent Johnson
Dave S wrote: > Hi all, > > I have been playing around with Python for a while now and am looking for > open source KDE projects written in Python that I can help with / learn from. > > Something relatively simple that uses Qt. (I am still a bit green) > > Any idea where I can get a list of pr

Re: [Tutor] Meaning of %g ?

2006-04-14 Thread Kent Johnson
Alan Gauld wrote: print "%14.3g\n%14.3e\n%14.3f" % (bignum,bignum,bignum) > 1.23e+009 > 1.235e+009 > 1234567898.235 > > Hopefully those examples show whats happening. > I have no idea why %g is dropping a digit, it may even be a bug! It looks to me like either a documentation error

Re: [Tutor] Databases

2006-04-14 Thread Alan Gauld
> I have some database files that are written in visual foxpro. I want to > be > able to access them, read them and amend them. Can I do this with python? I think you will need to use the OCDB adapter. Although there may be a Fox adapter out there somewhere, but I haven't seen any references to

Re: [Tutor] Meaning of %g ?

2006-04-14 Thread Alan Gauld
>> > %g: Same as "e" if exponent is greater than -4 or less than >> > precision, "f" otherwise. >> >> Yeah, thats not very clear. > >So what is the exact meaning ? I am still not clear. The exact meaning is that it will use the shorter of %e and %f. It's as simple as that., In some cases Scientifi