sneekula 969 Nearly a Posting Maven

Who is the true Sarah Palin?

sneekula 969 Nearly a Posting Maven
sneekula 969 Nearly a Posting Maven

Here is one approach to a rock, paper and scissors game in console format:

# Rock, paper and scissors game ...

import random

def game(you):
    """
    returns draw, win or lose in message string
    """
    # pick the computer hand
    comp = random.choice(hand)
    # determine the winner
    if you == comp:
        return "You %s and computer %s result is a draw!" % (you, comp)
    elif you == "rock" and comp == "scissors":
        return "You %s and computer %s you win!" % (you, comp)
    elif you == "paper" and comp == "rock":
        return "You %s and computer %s you win!" % (you, comp)
    elif you == "paper" and comp == "scissors":
        return "You %s and computer %s you lose!" % (you, comp)
    elif you == "rock" and comp == "paper":
        return "You %s and computer %s you lose!" % (you, comp)
    elif you == "scissors" and comp == "paper":
        return "You %s and computer %s you win!" % (you, comp)
    elif you == "scissors" and comp == "rock":
        return "You %s and computer %s you lose!" % (you, comp)
    else:
        return ""

print "Rock, paper and scissors game by ... "
print
print "Options:"
print "1  rock"
print "2  paper"
print "3  scissors"
print "4  random"
print "5  exit"
print

hand = ["rock", "paper", "scissors"]
win = 0
lose = 0
draw = 0
result = ""
while True:
    try:
        opt = int(raw_input("Enter your option number ( 1- 5): "))
    except:
        opt = 4  # default on error is random …
sneekula 969 Nearly a Posting Maven

At this point you better give us some code, or we all get lost.

sneekula 969 Nearly a Posting Maven

Bush Language:
"The administration I'll bring is a group of men and women who are focused on what's best for America, honest men and women, decent men and women, women who will see service to our country as a great privilege and who will not stain the house."

sneekula 969 Nearly a Posting Maven

Well said!

Another Senior Moment:

McCain: "Who is Barrack Obama?"
Voter1 : "Have you forgotten?"
Voter2 : "If you would read the newspapers, you would know!"
Voter3 : "He is that one, remember that one."

Lieberman whispering into McCains ear:
"Ask Sarah, she has him all figured out."

It would be truly funny, if it wouldn't be the sad truth.

sneekula 969 Nearly a Posting Maven

Ene, nice comment: "It's the Economy Stupid!"

sneekula 969 Nearly a Posting Maven

Also remember that the searched list weights has to be sorted for bisect to work!

sneekula 969 Nearly a Posting Maven

Blaming a bunch of bad mortgage loans at US institutions Fannie Mae and Freddie Mac for the whole worldwide financial crisis is rather simple-minded. The main cause are loans made between investment banks all over the world, in most cases totally unregulated by any of the governments involved.

sneekula 969 Nearly a Posting Maven

hahahaha, why thank you for saying that my english is better than bennet's, means alot to a guy who cant spell :P

My views on brown are very stong, just tell me where to post :D

Well, I started a thread called "Non-American Thoughts" (http://www.daniweb.com/forums/post710984.html#post710984) to get to know our international friends on DaniWeb a bit better.

sneekula 969 Nearly a Posting Maven

Well, we have a thread on North American Thoughts, but DaniWeb is an international community. So I put up this thread to ask for the thoughts, any thoughts, from our international friends.

Any thoughts about their country's leadership, politics, economy, education, beauty, worries, weather .....

We are all curious to learn.

sneekula 969 Nearly a Posting Maven

"McCain Speek", just an example:

sneekula 969 Nearly a Posting Maven

If you owe the bank $100 that's your problem. If you owe the bank $100 million, that's the bank's problem.

In the good old USA:
"If you owe the bank $100 that's your problem. If you owe the bank $100 million, that's the taxpayers' problem.

sneekula 969 Nearly a Posting Maven

Yes, I remember you. Also, your English was sooo much better than jbennet's. :)

Welcome back, temporary stranger, glad to have you back again.

Maybe you can give us an opinion on Mister Brown running England, or are you afraid of being spied upon by your security apparatus?

sneekula 969 Nearly a Posting Maven

McCain seems to be drifting closer to a strange kind of socialism. His taxcuts and all sorts of bailouts basically send the message, "If you vote for me, I will give you a million Dollars or more!"

The undisclosed fineprint says:
"Let your children and grandchildren pay for this one!"

sneekula 969 Nearly a Posting Maven

That policeman should shoot these people...

Are all your guns unloaded and locked up?

In Detroit it is very common to have a loaded gun ready and sitting right close to the entry door. After you have been robbed in your own house a few times and seen nothing but police inaction, you will do that!

sneekula 969 Nearly a Posting Maven

If your file is not too large, you can go as simple as this:

newuser = "hamster201"

fin = open("MyUserFile.txt", "r")
text = fin.read()
fin.close()

if newuser in text:
    print "this username already used"
sneekula 969 Nearly a Posting Maven

To be a Conservative you have to have something to conserve. I assume it's some kind of hoard stashed away someplace. If you have nothing, you might just be a Liberal.

sneekula 969 Nearly a Posting Maven

Nice humor from a guy we all admire:
"
See, one of the interesting things in the Oval Office -- I love to bring people into the Oval Office -- right around the corner from here -- and say, this is where I office, but I want you to know the office is always bigger than the person.
"

In the last debate I couldn't help but notice how much John McCain looks like Dick Cheney. However, Cheney has a much nicer smile.

sneekula 969 Nearly a Posting Maven

One of the reasons people cling to their hates so stubbornly is because they sense, that once hate is gone then they will be forced to deal with pain.

sneekula 969 Nearly a Posting Maven

I do like Miss Palin, she has single- handedly done more damage to the Republican ticket than anyone could imagine in their wildest dreams. Good work Sarah! Keep it up!

sneekula 969 Nearly a Posting Maven

Minnesota seems to be a hot bed of Obama hatred. The all white audience in the latest rally there booed even McCain himself, when he suggested that Obama was actually a nice man.

sneekula 969 Nearly a Posting Maven

The many posters here that support McCain shouldn't worry, Fox News has declared McCain the winner of the last debate. According to them 86% of their viewers said so.

Bill O'Reilly is busy spitting at the 14% that didn't go along!

sneekula 969 Nearly a Posting Maven

Tkinter should be fast enough unless the cars are going at the speed of sound.

sneekula 969 Nearly a Posting Maven

President George W. Bush after being asked by a child in Britain what the White House was like:
"It is white."

sneekula 969 Nearly a Posting Maven

A cab driver reaches the Pearly Gates and St. Peter looks him up in his Big Book. Upon reading the entry for the cabbie, St. Peter invites him to pick up a silk robe and a golden staff and to proceed into Heaven.

A preacher is next in line and has been watching these proceedings with interest. Upon scanning the preacher's entry in the Big Book, St. Peter furrows his brows and says, "Okay, we'll let you in, but take that cloth robe and wooden staff."

The preacher is astonished, "But I am a man of the cloth. You gave that cab driver a gold staff and a silk robe. Surely I rate higher than a cabbie."

St. Peter responded: "This is heaven and up here, we are interested in results. When you preached, people slept. When the cabbie drove his taxi, people prayed."

sneekula 969 Nearly a Posting Maven

Which president produced:

1. The highest growth in the gross domestic product?
2. The highest growth in jobs?
3. The biggest increase in personal disposable income after taxes?
4. The highest growth in industrial production?
5. The highest growth in hourly wages?
6. The lowest Misery Index (inflation plus unemployment)?
7. The lowest inflation?
8. The largest reduction in the deficit?

The answers: 1. Harry Truman, 2. Bill Clinton, 3. Lyndon Johnson, 4. John F. Kennedy, 5. Johnson, 6. Truman, 7. Truman, 8. Clinton. In the Economic Sweepstakes, Democratic presidents trounce Republicans eight times out of eight!

If this isn’t enough to destroy the myth that the economy has performed better under Republicans, the stock market has also done better under the Democrats. The Dow Jones Industrial Average during the 20th century has risen 7.3 percent on average per year under Republican presidents. Under Democrats, it rose 10.3 percent – which means investors gained a whopping 41 percent more. And the stock market declined further during George W’s two terms. Moreover, since World War II, Democratic presidents have increased the national debt by an average of 3.7 percent per year and Republican presidents have increased it an average of 10.1 percent. During the same time period, Democratic presidents produced, on average, an unemployment rate of 4.8 percent; Republicans, 6.3 percent. That’s the historical record.

Looks like you did your homewrk there!

Now, which presidents won the most wars?

sneekula 969 Nearly a Posting Maven

I just had to feed the troll, he was such a pooty-head. I must have looked at the wrong heading - I thought he had a larger post count. That means I wasted electrons for nothing as he won't be back.

I think this troll just came back from one of those "Hate Obama" speeches that beauty contest runner up Palin puts on to incite Republican mobs to a fever pitch.

sneekula 969 Nearly a Posting Maven

Give it a little test to familiarize yourself with dictionaries:

cards = {'rank' : (2, 3, 4, 5, 6, 7, 8, 9, 10, 'Jack', 'Queen', 'King', 'Ace'),
        'color' : ('Spade', 'Club', 'Diamond', 'Heart')}

for card in cards:
    print card
    print cards[card]

"""
my output --->
color
('Spade', 'Club', 'Diamond', 'Heart')
rank
(2, 3, 4, 5, 6, 7, 8, 9, 10, 'Jack', 'Queen', 'King', 'Ace')
"""
sneekula 969 Nearly a Posting Maven

What operating system are you using?
If you use Window's Vista expect problems with Tkinter during the installation. I remember from a friend that Vista's ever so stupid security scheme refuses to install some of the needed DLL files without letting you know.

If you have Vista, look into directory:
D:\Python25\DLLs
and see if any of these are there:
tk84.dll
_tkinter.pyd
I sort of remember that they were the problem files. If they are not there, find someone with Windows XP and copy from there.

Microsoft rules the World?

sneekula 969 Nearly a Posting Maven

wxPython supplies a progressbar called wx.Gauge(). Here is a short test code:

# a templet with wx.Frame, wx.Panel, wx.Slider and wx.Gauge
# wx.Gauge(parent, id, range, pos, size, style)
# (on Windows XP the slider responds to the mouse-wheel)
# sorry, but the gauge markers come only in green ar this time
# wx.Slider(parent, id, value, minValue, maxValue, pos, size, style)

import wx
import time

class MyPanel(wx.Panel):
    def __init__(self, parent):
        wx.Panel.__init__(self, parent, wx.ID_ANY)
        self.SetBackgroundColour("white")

        # initial value = 50, minvalue = 0, maxvalue = 100
        self.slider = wx.Slider(self, wx.ID_ANY, value=50, minValue=0,
            maxValue=100, pos=(10, 10), size=(390, 50),
            style=wx.SL_HORIZONTAL|wx.SL_AUTOTICKS|wx.SL_LABELS)

        # range set to 0 to 100, default style is wx.GA_HORIZONTAL
        # other style option is wx.GA_VERTICAL
        self.gauge1 = wx.Gauge(self, wx.ID_ANY, range=100, pos=(10, 70),
            size=(390, 25), style=wx.GA_HORIZONTAL)
        self.gauge2 = wx.Gauge(self, wx.ID_ANY, range=100, pos=(375, 100),
            size=(25, 155), style=wx.GA_VERTICAL)

        # set gauges to initial slider position
        self.pos1 = self.slider.GetValue()
        self.gauge1.SetValue(self.pos1)
        self.gauge2.SetValue(self.pos1)

        s1 = "the gauge is bound to the slider,"
        s2 = "just click and drag the pointer"
        self.label1 = wx.StaticText(self, wx.ID_ANY, s1+s2, pos=(10, 100))
        self.label2 = wx.StaticText(self, wx.ID_ANY,
            "the gauge can use a timer loop" , pos=(10, 140))
        self.button = wx.Button(self, wx.ID_ANY, "Press to start timer",
            pos=(10, 170))

        # respond to changes in slider position ...
        self.slider.Bind(wx.EVT_SLIDER, self.sliderUpdate)
        # respond to the click of the button
        self.button.Bind(wx.EVT_BUTTON, self.button1Click)

    def sliderUpdate(self, event):
        # get the slider position
        self.pos1 = self.slider.GetValue()
        # set the gauge positions
        self.gauge1.SetValue(self.pos1)
        self.gauge2.SetValue(self.pos1)

    def button1Click(self, event):
        for k in range(101):
            # move the progress bar/gauge
            self.gauge1.SetValue(k)
            self.gauge2.SetValue(k)
            # move the slider …
sneekula 969 Nearly a Posting Maven

Let's not totally forget the McCain accepted the endorsements of the pastors Rod Parsley and John Hagee. There were media reports about Parsley's vitriol toward Islam and Hagee's denounciation of the Catholic Church as the"great whore" and statements like "Hurricane Katrina was the judgment of God against New Orleans."

Lots of pretty sick stuff out from these two fellows that McCain was "palling" around with.

sneekula 969 Nearly a Posting Maven

Ian Fleming named his famous spy after an author in what scientific field?

sneekula 969 Nearly a Posting Maven

Homemade meatloaf with mashed potatoes and chives.

My gf's mother made some soft pretzels, they are real good with butter.

sneekula 969 Nearly a Posting Maven

William Ayers was an activist when Obama was 8 years old. This McCain smear campaign starts to look silly.

McCain in a BeliefNet interview in which said, "I would probably have to say yes, that the Constitution established the United States of America as a Christian nation." This despite the fact that the Constitution, which McCain has presumably read, does the exact opposite.

Former Bush White House aide David Kuo, now a BeliefNet contributor, said McCain was "pandering to what he thinks the Christian conservative community wants to hear."

sneekula 969 Nearly a Posting Maven

John McCain at a fundraising dinner in Arizona a decade ago. "Do you know why Chelsea Clinton is so ugly?" he told a handful of big Republican funders. "Because Janet Reno is her father."

http://www.guardian.co.uk/lifeandstyle/2008/sep/02/women.johnmccain

sneekula 969 Nearly a Posting Maven

Here are the 10 worst states to find work ranked by their unemployment rates.


1. Michigan
Unemployment rate: 7.6 percent
Population: 10,071,822
Mean annual wage: $41,230
Top industry: Trade, transportation and utilities (18.4 percent)***


2. Mississippi
Unemployment rate: 6.8 percent
Population: 2,918,785
Mean annual wage: $30,460
Top industry: Government (21.2 percent)


3. South Carolina
Unemployment rate: 6.6 percent
Population: 4,407,709
Mean annual wage: $33,400
Top industry: Trade, transportation and utilities (19.4 percent)


4. Alaska
Unemployment rate: 6.5 percent
Population: 683,478
Mean annual wage: $43,920
Top industry: Government (25.9 percent)


5. California
Unemployment rate: 6.1 percent
Population: 36,553,215
Mean annual wage: $44,180
Top industry: Trade, transportation and utilities (18.9 percent)


6. District of Columbia
Unemployment rate: 6.1 percent
Population: 588,292
Mean annual wage: $61,500
Top industry: Government (33.3 percent)


7. Ohio
Unemployment rate: 6 percent
Population: 11,466,917
Mean annual wage: $37,360
Top industry: Trade, transportation and utilities (19.3 percent)


8. Arkansas
Unemployment rate: 5.9 percent
Population: 2,834,797
Mean annual wage: $30,870
Top industry: Trade, transportation and utilities (20.6 percent)


9. Nevada
Unemployment rate: 5.8 percent
Population: 2,565,382
Mean annual wage: $36,000
Top industry: Leisure and hospitality (26.5 percent)


10. Kentucky
Unemployment rate: 5.7 percent
Population: 4,241,474
Mean annual wage: $33,490
Top industry: Trade, transportation and utilities (20.4 percent)


The most recent numbers I could get. Notice Alaska, the top employer there is Government.

sneekula 969 Nearly a Posting Maven

In the news today:

The former CEO of the bankrupt Lehman Brothers, Richard Fuld, became the poster boy for Wall Street greed today as he defended the $484 million he received in salary, bonuses and stock options since 2000.

With that kind of income George Bush's taxcut makes a lot of sense. Wonder which foreign country he use to stash the loot?

sneekula 969 Nearly a Posting Maven

In the news:
South Korea's food watchdog finds melamine in China-made Snickers.

No wonder they taste sooo good!!!!

sneekula 969 Nearly a Posting Maven

You betcha! She thinks we are all hockey pucks!

sneekula 969 Nearly a Posting Maven

Americans: always willing to share. :icon_razz:

Very good find!

sneekula 969 Nearly a Posting Maven

George W. Bush declining to take reporters' questions during a photo op with Canadian Prime Minister Jean Chretien in 2001:
"Neither in French nor in English nor in Mexican."

sneekula 969 Nearly a Posting Maven

Two blondes were driving down the road.

The blonde driving looks at her friend in the passenger seat and asks her to see if her blinker is working. So the blonde looks out the window and says, ''Yes. No. Yes. No.''

sneekula 969 Nearly a Posting Maven

McCain has his foot firmly planted in the financial wordl Take a look at:
http://www.azcentral.com/news/election/mccain/articles/2007/03/01/20070301mccainbio-chapter7.html

sneekula 969 Nearly a Posting Maven

The meek shall inherit the earth.

Does that mean:
"The rich shall lose their BMWs in the stock market."

sneekula 969 Nearly a Posting Maven

"There’s a place in hell reserved for women who don’t support other women."
~~~ Sarah Palin

Midly beyond her usual smear stuff.

sneekula 969 Nearly a Posting Maven

Out of the corner of my tearful eye I noticed that I made my post #1000!

I am elated, exhilarated, jubilant, overjoyed, ecstatic and happy!

Time to get that 12 year old wine out of the cellar.

Let's toast to that fantastic accomplishment!

sneekula 969 Nearly a Posting Maven

Vanilla chocolate ice cream swirl.

sneekula 969 Nearly a Posting Maven

Imagine this ...

Palin sitting in the Oval Office, the country's leader after McCain got incapacitated eating some of those pretzels left behind by the previous president. The door opens and the Secretary of Defense enters.

"Mom, the Iranians just attacked Israel with some of their fearsome WetNoodle rockets. What should we do?"

"Son, you can call me Miss President, or also just President."

Palin is shuffling her deck of cheat-cards and pulling one out.

"As previous Mayor of one of the largest cities in Alaska and Governor of Alaska, a state full of Joe-sixpacks, I say drill baby drill!"

"But President Mom, we are talking about war not energy!"

More shuffling of the cheat-cards.

"Okay, send General McLellan and also his Nato troops in from Afghanistan."

"But President Mom, General McLellan served under Lincoln."

"Have him get out from under his Lincoln and attack post haste! That's an order son!"

Hehehe! You should get the Pooplizer Prize for that! :)

sneekula 969 Nearly a Posting Maven

Can you give us your whole error message?