sneekula 969 Nearly a Posting Maven

This forum frowns on spam!

sneekula 969 Nearly a Posting Maven

Hey welcome
Have a great stay! :)

sneekula 969 Nearly a Posting Maven

Shalom and howdy-do Lab!
What are you interested in and what skills are you anxious about?

Don't spend too much time in the Geek's Lounge. The stick-in-the-muds will pull you down to their level and make a conservative out of you. Who needs more of those? :)

sneekula 969 Nearly a Posting Maven

Hello Kid!
What are you interested in and what skills do you want to learn?

sneekula 969 Nearly a Posting Maven

Hallo Sharky!
What are you interested in and what skills do you want to improve?

sneekula 969 Nearly a Posting Maven

Hallo P2MS!
What are you interested in and what skill do you want to learn?

sneekula 969 Nearly a Posting Maven

Hallo Peter!
What are your interest and skills?

sneekula 969 Nearly a Posting Maven

Hello everyone, I am a newbie her and also to the python programing language, I m trying to learn wxPython........

Welcome, see you in the DaniWeb Python Forum then. Read though the "Starting wxPython" sticky and ask question in the Python forum. Many of us are glad to help!
http://www.daniweb.com/forums/thread128350.html

sneekula 969 Nearly a Posting Maven

Hi sahana, what kind of programming skills do you have?

sneekula 969 Nearly a Posting Maven

Iam new user
nice to meet you

Welcome! It would be nice if you could let us know a little about you and your skills.

sneekula 969 Nearly a Posting Maven

I need help any one ???? link exchange possible <URL SNIPPED>

Linking to a website for commercial gains is called spam and is frowned upon!

sneekula 969 Nearly a Posting Maven

This will show you one way to do this:
http://www.daniweb.com/forums/post694993-77.html

sneekula 969 Nearly a Posting Maven

Using wx.StaticBitmap() to show an image. Here we position the image in the center of the frame. Actually, the center of the panel that fills the frame:

# show a .jpg .png ,gif .bmp image using a wx.StaticBitmap()
# wx.StaticBitmap(parent, id, label, pos, size, style)
# calculate pos so image is in center

import wx

class ImagePanel(wx.Panel):
    """ create a panel with a wx.StaticBitmap """
    def __init__(self, parent):
        wx.Panel.__init__(self, parent, wx.ID_ANY)

        # pick an image file you have in the working folder
        # (can be a .jpg .png ,gif or .bmp image file)
        image_file = 'chemist.gif'
        bmp = wx.Bitmap(image_file)
        # get the width and height of the image
        wi, hi = bmp.GetSize()
        # get the width and height of the frame
        wf, hf = parent.GetSize()
        # calculate position so image is centered
        px = wf/2 - wi/2
        # 15 is estimated height of frame's title bar
        py = hf/2 - hi/2 - 15
        # show the static bitmap
        wx.StaticBitmap(self, wx.ID_ANY, bmp, pos=(px, py))

        # optionally show some image information
        info = "%s  %dx%d" % (image_file, bmp.GetWidth(), bmp.GetHeight())
        # the parent is the frame
        parent.SetTitle(info)


app = wx.App(redirect=False)  # stderr/stdout --> console
# create window/frame
frame = wx.Frame(None, wx.ID_ANY, size = (640, 480))
# create the panel instance
ImagePanel(frame)
# show the frame
frame.Show(True)
# start the GUI event loop
app.MainLoop()
sneekula 969 Nearly a Posting Maven

Ouch!
Barack Obama 42
John McCain 11

sneekula 969 Nearly a Posting Maven

Q: "Why doesn't the sun shine at night when we need all the light?"
A: "Most books now say our sun is a star. But it still knows how to change back into a sun in the daytime."

sneekula 969 Nearly a Posting Maven

ACME Cemetery Marker Ltd.:
"People are dying to get our products."

sneekula 969 Nearly a Posting Maven

Better than a thousand hallow words is one word that brings peace.
~~~ Siddhartha Gautama

sneekula 969 Nearly a Posting Maven

Just wonderful!

sneekula 969 Nearly a Posting Maven

What did you not like, the sugar or the puddin'?
Oh, and I am not Dave. How sweet that you're thinking of him.

Funny, I never felt superior to anyone, and never even hinted to it. However, I know someone that works in that frame of mind. Do you remember this?


Am I sorry that you didn't like the linked funny. Perhaps, this time there's luck?

Got to send Dave off to comedy school. Even stick in the mud conservatism can be cured.

sneekula 969 Nearly a Posting Maven

The only useful thing I can do in kitchen is boiling water, so oh yes, its boiled water for my sore throat for me. ;-)

Oh dear, hope you get better! Camomile tea and honey works well.

sneekula 969 Nearly a Posting Maven

Build in voice analysis and you got a perfect system.

Even simple stuff like what's your mother's maiden name could do.

sneekula 969 Nearly a Posting Maven

You should learn how to hide your true colors a little bit better, sugar puddin'.
First you use the document with sarcasm:

and later on try to convince us that you have respect for it:

Manipulator! All that you wanted to show it is some support for Mister Obama. But what you have achieved it is to show what kind of supporters he attracts.

[edit:] Here, have a cookie and enjoy.

Okay Dave, tone down and stop that name calling stuff!

My advice:
"Remember that fear always lurks behind perfectionism. Confronting your fears and allowing yourself the right to be human can, paradoxically, make you a far happier and more productive person."

sneekula 969 Nearly a Posting Maven

From the Bible:
"A feast is made for laughter, and wine maketh merry: but money answers all things."

sneekula 969 Nearly a Posting Maven

Just some observations from todays US news.

Palin in Wisconsin:
"In a Palin McCain Administration ....."
(come McCain my act dead, but he isn't)

McCain:
"If I were President, I would fire the chairman of the SEC ....."
Imaginary Lieberman whispering in the old man's ear:
"Dear, the President does not have the authority to fire him."

sneekula 969 Nearly a Posting Maven

Wow - that is an astonishing bit of sophistry.

I wish there was more I could say but the purity of your statement and the amount of mental distortion required to come up with that short piece of prose is staggering.

JW, you are either the god of all trolls or you have turned yourself into a klein bottle.

Let's face it JW comes from another world. Maybe he eats too many fermented tulip bulbs.

Well, the hobble about Palin has straightened a bit, and she looks more like ho-hum whatever.

sneekula 969 Nearly a Posting Maven

Hard to believe that one being created all of this!

sneekula 969 Nearly a Posting Maven

.....
I love listening to hardcore when coding, is that wrong?

A couple of Hail Mary will absolve you!

My best loved classic bands are:

The Kinks

The Police

The Bee Gees

Die Ärzte

Rammstein

Deep Purple

sneekula 969 Nearly a Posting Maven

You might want to be sure the front side is a match to what the backside presages.

Correct! You won the door price!

Q: "Why do cemeteries have fences around them?"
A: "ni teg ot gniyd era elpoep esuaceb"

~s.o.s~ commented: The best question of the day so far! +23
sneekula 969 Nearly a Posting Maven

“We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America... Done... the seventeenth day of September, in the year of our LORD one thousand seven hundred and eighty seven.” —George Washington and the delegates

Today, 17 September, marks the 221st anniversary of the Constitution’s signing by our nation’s Founders.

Thank you so much Dave for pointing out the all important US constitution.

May I point out that Barack Obama taught constitutional law at the prestigious University of Chicago Law School from 1992 to 2004. I am sure he will not soil this important document in any way, unlike the present administration.

sneekula 969 Nearly a Posting Maven

"Yesterday is not ours to recover, but tomorrow is ours to win or to lose."

sneekula 969 Nearly a Posting Maven

maybe. But remember that many of those illegals are using the voter registration cards of dead people (and their SSNs).
One more reason leftists are opposed to throwing out illegals and closing down the border so they can't get in again.

Actually most of those illegals vote Republican.

sneekula 969 Nearly a Posting Maven

Move over, Al Gore. You may lay claim to the Internet, but John McCain helped create the BlackBerry.

At least that's the contention of a top McCain policy adviser, Douglas Holtz-Eakin.

Spectacular feat! McCain himself has acknowledged that he doesn't know how to use a computer and can't send e-mail, one of the BlackBerry's prime functions.

sneekula 969 Nearly a Posting Maven

Yup, here are the hypocrites!

http://www.youtube.com/watch?v=wQK1al91drs

sneekula 969 Nearly a Posting Maven

You too can have a funny moment:
http://www.youtube.com/watch?v=iqMxxruirrE

Jon Steward so much in love with Sarah Palin that he went out and killed an animal for her in the nearby park!

sneekula 969 Nearly a Posting Maven

ANCHORAGE, Alaska (AP) -- Gov. Sarah Palin may eventually have said ''no thanks'' to a federally funded Bridge to Nowhere. But a bridge to her hometown of Wasilla, that's a different story. A $600 million bridge and highway project to link Alaska's largest city to Palin's town of 7,000 residents is moving full speed ahead, despite concerns about wasting federal money.

sneekula 969 Nearly a Posting Maven

>> I was going to put this in my geek thread but since it is really about dark matter, well - here is a geek rap about looking for dark matter.
That made me cringe, but like a car crash, I couldn't stop watching it.
.....

Interesting, a dark rap!

sneekula 969 Nearly a Posting Maven

Well, if you can observe it, then it wouldn't be dark matter.

sneekula 969 Nearly a Posting Maven

This thread should be called:
"God's Matter and God's Energy"

sneekula 969 Nearly a Posting Maven

Palin was identified as a potential future leader of the neoconservative cause in June 2007, when the annual summer cruise organised by the right-of-centre Weekly Standard magazine docked in Juneau, Alaska:
http://www.telegraph.co.uk/news/newstopics/uselection2008/sarahpalin/2827217/Neoconservatives-plan-Project-Sarah-Palin-to-shape-future-American-foreign-policy.html

The American Enterprise Institute, a bastion of Washington neoconservatism, sums up Palin: "She's bright and she's a blank page."

sneekula 969 Nearly a Posting Maven

Could a counselor substitute for a mentor? Counselors are plentyful, mentors are in very short supply.

sneekula 969 Nearly a Posting Maven

Truth is a stranger.

sneekula 969 Nearly a Posting Maven

Q: "What can a goose do, that a duck can't do, and a lawyer should do?"
A: "Stick his bill up his pooper."

sneekula 969 Nearly a Posting Maven

A nice project! Welcome to the small group of DaniWeb Pythonoreans and Pythealots here.

sneekula 969 Nearly a Posting Maven

A man went into the fitting room of a local clothing store, after a while he yelled rather loudly, "There is no paper in here!"

sneekula 969 Nearly a Posting Maven

Talking about lipstick!

sneekula 969 Nearly a Posting Maven

I Hate to Hate my Hate.

sneekula 969 Nearly a Posting Maven

The opposite of the greenies must be the brownies, called so for their brown noses?

sneekula 969 Nearly a Posting Maven

Being thrown out of your home, spouse kids and all, because of fraudulent banking practices shouldn't also steal your right to vote!

Having dead democrats vote is a minor problem. In most states illegal immigrants can easily vote, they have an address. Also, a huge amount of votes are thrown out because of minor flaws. Let's face it, voting in the US is on a working day, making it harder for a working person to vote.

sneekula 969 Nearly a Posting Maven

To destroy widgets that belong together, put them on a frame:

# a look at Tkinter's frame widget
# a frame wraps the widgets put on it

from functools import partial  # needs Python25 or higher
import random
import Tkinter as tk

def make_frame(parent, frame=None, color='white'):
    global count
    count += 1
    parent.title("Frame %d" % count)
    if frame:
        # destroy any old frame and its widgets
        frame.destroy()
    # now create a new frame
    frame = tk.Frame(top, bg=color)
    frame.pack(expand="true")

    # give the frame some widgets
    b1 = tk.Button(frame, text=color+"_button1")
    b2 = tk.Button(frame, text=color+"_button2")
    b3 = tk.Button(frame, text=color+"_button3")

    color = random.choice(['red', 'green', 'yellow', 'blue', 'cyan'])
    # use partial callback to pass arguments
    par_callback = partial(make_frame, parent, frame, color)
    b4 = tk.Button(frame, text="Create new frame", command=par_callback)

    # you can use pack() for the frame and grid() for its widgets
    b1.grid(row=0, column=0, padx=15, pady=5)
    b2.grid(row=1, column=1, padx=15, pady=5)
    b3.grid(row=2, column=2, padx=15, pady=5)
    b4.grid(row=3, column=3)
    return frame

top = tk.Tk()
count = -1
# initial dummy
frame1 = make_frame(top)

frame2 = make_frame(top, frame1)

top.mainloop()
sneekula 969 Nearly a Posting Maven

Tkinter's 'command=' accepts a function reference not a function call, so you have to use a callback arrangement to pass arguments:

# Tkinter example showing several ways for command to pass an argument

import Tkinter as tk

# use a closure
def closure_callback(val):
    def closure():
        root.title(val)
    return closure

def change_title(val):
    root.title(val)

# note in this case callback is onButton3
def curry_callback(callback, *args, **kwargs):
    """adds arguments to callback functions"""
    def do_call():
        return callback(*args, **kwargs)
    return do_call

def onButton3(val):
  root.title(val)

root = tk.Tk()

s1 = "passing a string to the title using a closure_callback"
button1 = tk.Button(root, text=s1, command=closure_callback(s1))
button1.pack(padx=100, pady=10)

s2 = "passing a string to the title using a lambda_callback"
lambda_callback = lambda: change_title(s2)
button2 = tk.Button(root, text=s2, command=lambda_callback)
button2.pack(padx=100, pady=10)

s3 = "passing a string to the title using a curry_callback"
button3 = tk.Button(root, text=s3, command=curry_callback(onButton3, s3))
button3.pack(padx=100, pady=10)

root.mainloop()

Also note that Python25 has a class 'partial' that works much like 'curry'.