Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
dict() -> new empty dictionary
dict(mapping) -> new dictionary initialized from a mapping object's
    (key, value) pairs
dict(iterable) -> new dictionary initialized as if via:
    d = {}
    for k, v in iterable:
        d[k] = v
dict(**kwargs) -> new dictionary initialized with the name=value pairs
    in the keyword argument list.  For example:  dict(one=1, two=2)

src/p/y/pyGBot-HEAD/pyGBot/Plugins/games/ApplesToApples.py   pyGBot(Download)
 
# Import the card lists.
from ApplesCards import GREENCARDS, REDCARDS
 
# Note: When sending messages, codes such as "\x034" refer to IRC
        random.shuffle(self.playedcards)
        for i in range (0, len(self.playedcards)):
            self.bot.pubout(self.channel, "%i. \x034%s\x0F: %s" % (i+1, self.playedcards[i][1], REDCARDS[self.playedcards[i][1]]))
        # Judge prompt and syntax reminder
        self.bot.pubout(self.channel, "\x02\x0312%s\x0F: Please make your decision now using the '!pick <number>' command." % self.live_players[self.judgeindex])
                self.hands[user].append(self.reddeck.pop(0))
                # Tell them what card they just drew, with extra text
                self.privreply(user, "You draw: \x034%s\x0F: %s" % (self.hands[user][len(self.hands[user])-1], REDCARDS[self.hands[user][len(self.hands[user])-1]]))
        # For every player, build a string and send them their hand
        for user in self.live_players:
                    if int(args[0]) > 0 and int(args[0]) <= len(self.hands[user]):
                        # Privately tell them the card text
                        self.privreply(user, "\x034%s\x0F - %s" % (self.hands[user][int(args[0])-1], REDCARDS[self.hands[user][int(args[0])-1]]))
                    else:
                        # "What do you mean, card 11?"
                    while len(self.hands[user]) < 7:
                        self.hands[user].append(self.reddeck.pop(0))
                        self.privreply(user, "You draw: \x034%s\x0F: %s" % (self.hands[user][len(self.hands[user])-1], REDCARDS[self.hands[user][len(self.hands[user])-1]]))
                hand = []
                for i in range (1, 8):