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] printing an acronym (fwd)

2005-09-26 Thread Allen John Schmidt, Jr.
Or a shorter version, a=lambda n: "".join([x[0].upper() for x in n.split()]) Then it is just: >>> a('random access memory') 'RAM' Danny Yoo wrote: Forwarding to tutor -- Forwarded message -- Date: Mon, 26 Sep 2005 08:32:02 -0500 From: Jason Massey <[EMAIL PROTECTED]> T

Re: [Tutor] Please help

2005-08-03 Thread Allen John Schmidt, Jr.
Whoops! Had to correct it! Hey, I had a similar problem not too long ago. My data came in the first format, but I didn't need it formated like that. Here is how I would have written it: import re col=re.compile('(AD.*?)\s*$') datas=re.compile('\s*(.+?)\s+(.+?)') f1 = open('xx','r') mind={} match

Re: [Tutor] Please help

2005-08-03 Thread Allen John Schmidt, Jr.
Hey, I had a similar problem not too long ago. My data came in the first format, but I didn't need it formated like that. Here is how I would have written it: import re col=re.compile('(AD.*?)\s*$') datas=re.compile('\s*(.+?)\s+(.+?)') f1 = open('xx','r') mind={} matching='' for i in meat:

Re: [Tutor] Dictionary Inserts...

2005-05-05 Thread Allen John Schmidt, Jr.
Arrgh! How could I be so stupid! :) Thanks for the help! I know many things about python, but I can't believe that I didn't know that! Thanx again! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Dictionary Inserts...

2005-05-05 Thread Allen John Schmidt, Jr.
Ok, I have had enough. I have looked all through the python docs and I cannot find it. How do you insert an entry into a dictionary? Thanx! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] problem

2005-05-03 Thread Allen John Schmidt, Jr.
Feziwe Mpondo wrote: >hi >problem :modification of a guessing game excersize to a password asking >program. her's what i tried. >s = raw_input > > What is this here for? >#asks for a password >#prints it if correct >password = input( "Tell me a password: ") > > This is correct, but >passwor