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 """ %
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
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
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:
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
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
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