I still have the screenshot somewhere from my 666th :D
Good God, I didn't know that 666 was that important! On my annual religious pilgrimage to Las Vegas I am hoping for a 777 or 77777 to pop up.
I still have the screenshot somewhere from my 666th :D
Good God, I didn't know that 666 was that important! On my annual religious pilgrimage to Las Vegas I am hoping for a 777 or 77777 to pop up.
Before we can forgive one another, we have to understand one another.
Just saw this in the news:
Denmark's parliament on Monday approved the construction of a 400 megawatt (MW) offshore wind turbine park. The park will generate enough electricty to power 400 000 Danish homes. Denmark is home to Vestas, the world's biggest supplier of wind turbines.
I've got the "antivirus vista 2009" (worm or virus, I don't know), it did his thing and immediately offer to clean my computer for 90 dollars, that's why I got mad, they mess your computer and then try to steal your money!!
People who does not know how to fix it will pay...
The "antivirus vista 2009" comes in from visiting porno sites. There are ways to get rid of this pest, just google. I am told that it is a very nasty program that keeps reinfecting unless you know all the tricks to get rid of it. Maybe it's a program put out by the righteous Christian Right to punish the axis of evil doers. :)
When he was called on this - he said "I was a prisoner and tortured". This is becoming the equivalent of Rudy Giuliani's working '9/11' into every conversation.
We could start a drinking game - take a drink every time McCain or his cronies mention POW, torture, or the equivalent/
You would spend most of your time drunk!
Just make sure that your harmonies aren't sour notes.
Yeah efmesch, great though of the day! Actually, not just of the day.
Of all the things I've lost, I miss my mind the most.
(Mark Twain?)
An ant brain has about 250 000 brain cells. A human brain has 10 000 million so a colony of 40 000 ants has collectively the same size brain as a human.
Someone really smart better check the math on that.
Well, i checked it out for you:
print 250000 * 40000 # result --> 10000000000
Did you know that the bird with the largest wingspan is the Wandering Albatross Diomedea Exulans with wings covering around 10 feet (3.048 meter)?
Here is a chance for lackluster McCain to make an angry Hillary Clinton his running mate!
Now that is funny! Go get'em Lardo!
It's hard to blame Sen. Clinton for being bitter. Here she is, the smartest human ever, PLUS she spent all those years standing loyally behind Bill Clinton wearing uncomfortable pantyhose (I mean Hillary was, not Bill) (although there are rumors).
Quoted by Mister Barry
W: "We will make sure our troops have all that is necessary to complete their missions. That's why I went to the Congress last September and proposed fundamental -- supplemental funding, which is money for armor and body parts and ammunition and fuel."
I don't think this is very funny, it is rather sad IMHO!
Just noticed that I passed the ever so sweet 1000 postings mark!
Isn't DaniWeb great!
Oh, I love mushrooms. Would be nice if my folks could afford a cook! I just had a Sweet&Salty Granola Bar from Kroger with my usual cup of Royal Kona coffee (Sunday only).
In case you are broke like me and want free samples:
http://startsampling.com/retail/kroger/
To create a window or frame with wxPython you use wx.Frame. There are some basic things you can do with a frame and I tried to put them in one spot:
# a few things you can do with wxPython's wx.Frame
# wx.Frame(parent, id, title, pos, size, style, name)
# set/change colour, cursor, position, size, title, tooltip
# blow the frame to full size and return to normal
import wx
class MyFrame(wx.Frame):
"""inherits wx.Frame, self is the instance of the frame"""
def __init__(self):
# create a frame/window, no parent, default to id=wxID_ANY
# note that id=wxID_ANY is the same as id=-1
# position is overwritten by Center()
wx.Frame.__init__(self, None, wx.ID_ANY, 'original title',
pos=(100, 150), size=(400, 350))
# show the frame during the creation of the instance
# default is True, False would hide the frame
self.Show(True)
# wait just a moment, 4.5 seconds to be exact
wx.Sleep(4.5)
# this allows you to change the frame title
self.SetTitle('changed title, colour, and cursor')
# optionally change the cursor
self.SetCursor(wx.StockCursor(wx.CURSOR_MAGNIFIER))
# change the frame's colour
# notice British spelling of Colour
self.SetBackgroundColour('green')
# now clear old color, set to new color
self.ClearBackground()
self.Show()
wx.Sleep(4.5)
self.SetTitle('center wx.Frame horizontal')
# optionally center the frame on the display screen
# notice British spelling of Centre
# wx.HORIZONTAL, wx.VERTICAL or wx.BOTH (default)
self.Centre(wx.HORIZONTAL)
self.Show()
wx.Sleep(4.5)
cap = 'now center wx.Frame vertical too and change size'
self.SetTitle(cap)
#self.Update()
# change the size of the frame
width, height = self.GetSize()
# needs tuple
self.SetSize((width+200, height-100))
# in this …
McCain needs your vote!
He has got them! According the August Reuters/Zogby poll McCain leads Obama among likely U.S. voters by 46 percent to 41 percent. What a wonderful man!
There are quite a few US military advisers in this Georgia country trying to rearm Georgia to NATO standards. Maybe the Russians want to get get even with the Georgians for sending them the one thing that has killed more Russians than aything else --> Joseph Stalin!
I find it strange that the Bush policy is to urinate on the Russians over some small cow dung country. Let's face it the Russians have plenty of nukes, and we need their close cooperation in the war on terror!
Osetia is to the Georgians what Kosovo was to the Serbians. So, when Georgia does a little landgrab and cleansing it's okay with the US?
My advice for you is to study up on the very basics of Python. Your code is simply loaded with too many rudimentary mistakes!
Wow, why is Python so specific about the 3 being a float in order for it not to round the answer? Thanks though Gribouillis, as I now learned something new today :)
Most computer languages consider integer/integer an integer division and for instance 1/2 will give you 0. Conversely float/integer or integer/float will be considered a floating point division, such that 1.0/2 will give 0.5
The new version 3.0 of Python will depart from this traditional concept and make / a floating point division and // an integer division.
Also
ballSpeed = [0,4]
means move the ball 0 pixels along the x axis and 4 pixels along the y axis. Pixels have to be integers. When you set it to [0,0] it stops of course.
Maybe the convention will pick her after all!
We all know who the monkey is, but who is the nice looking lady?
The human body contains 60,000 miles of blood vessels and 93,000 miles of nerves.
The wx.SplitterWindow() could have some interesting applications:
# testing wxPython's interesting
# wx.SplitterWindow(parent, id, pos, size, style)
# the size can be changed by dragging the interior borders
#
# style =
# wx.SP_3D draws a 3D effect border and sash (default)
# wx.SP_BORDER draws a standard border
# wx.SP_LIVE_UPDATE resize the child windows immediately
import wx
class MyFrame(wx.Frame):
def __init__(self, parent, mytitle, mysize):
wx.Frame.__init__(self, parent, wx.ID_ANY, mytitle, size=mysize)
self.splitter1 = wx.SplitterWindow(self, wx.ID_ANY,
style=wx.CLIP_CHILDREN|wx.SP_LIVE_UPDATE|wx.SP_3D)
self.splitter2 = wx.SplitterWindow(self.splitter1, wx.ID_ANY,
style=wx.CLIP_CHILDREN|wx.SP_LIVE_UPDATE|wx.SP_3D)
self.panel1 = wx.Panel (self.splitter1, wx.ID_ANY)
self.panel1.SetBackgroundColour ("red")
self.panel2 = wx.Panel (self.splitter2, wx.ID_ANY)
self.panel2.SetBackgroundColour ("white")
self.panel3 = wx.Panel (self.splitter2, wx.ID_ANY)
self.panel3.SetBackgroundColour ("blue")
# set splitters direction and content (top or left first)
# and sash position
self.splitter1.SplitVertically(self.panel1, self.splitter2, 200)
self.splitter2.SplitHorizontally(self.panel2, self.panel3, 140)
app = wx.App(0)
# create a MyFrame instance and show the frame
MyFrame(None, 'test the wx.SplitterWindow()', (400, 300)).Show()
app.MainLoop()
Just some wxPython code to show you how to draw a bar chart:
# using wxPython's
# wx.lib.plot.PlotCanvas() to show a colourful bar chart
import wx
import wx.lib.plot
class MyFrame(wx.Frame):
def __init__(self, parent, mytitle, mysize):
wx.Frame.__init__(self, parent, wx.ID_ANY, mytitle, size=mysize)
# data values indicate upper value of each bar
# bars are drawn as thick vertical lines
# data set one
data1 = [5, 8, 12, 9.5, 7, 5.5, 4.5, 3]
# data set two
data2 = [3, 7, 13.5, 9, 6, 3.5, 2, 1]
plot_canvas = wx.lib.plot.PlotCanvas(self)
# create list of bars for data1
bar_colour = 'red'
bars1 = []
for x in range(len(data1)):
x1 = 2*x
y1 = data1[x]
bars1.append(wx.lib.plot.PolyLine([(x1, 0), (x1, y1)],
legend='1', colour=bar_colour, width=20))
# create list of bars for data2
bar_colour = 'blue'
bars2 = []
for x in range(len(data2)):
x1 = 2*x+1
y1 = data2[x]
bars2.append(wx.lib.plot.PolyLine([(x1, 0), (x1, y1)],
legend='', colour=bar_colour, width=20))
# set up the graphics
gc = wx.lib.plot.PlotGraphics(bars1 + bars2,
'2007 Sales Vista (red) Linux (blue)',
'X Axis (Sales Period)',
'Y Axis (1000 Euro)')
# then plot it
plot_canvas.Draw(gc, xAxis=(-0.5, 15), yAxis=(0, 15))
app = wx.App(True)
# create the MyFrame instance and then show the frame
caption = "wx.lib.plot.PlotCanvas() Bar Chart"
MyFrame(None, caption, (500, 400)).Show(True)
app.MainLoop()
It takes government by the people for the people, not government by lobbyist for lobbyists.
Let's all become lobbyists, then we are back to normal.
Half the World's population has never used a telephone.
I am just cooking myself a couple of sunnysides, great with whole-wheat toast and a full mug of Irish coffee.
But which one is the monkey?
It's the one on your back!
That is the way geography is taught in our public schools.
I think it is also the map that hangs in Dick Chainey's basement office.
if there was another option, for example:
option A: Obama
option B: McCain
option C: They All SuckI wonder how many people would choose option C?
(Pretty sure I would)Better yet, what would happen if the majority chose option C?
C all the way! Throw the bums out!
Unfortunately in the USA, the only way you can register your displeasure with the present corrupt political system is not to vote.
Oh yes, four more years of irresponsible fiscal behaviour, just what this country needs. God help us all!
Let's not forget that is was the Democrats that repealed the usury laws that prohibited predatory lending in the late 1970s. That made possible sky high interest rates on credit cards, payday loans, subprime mortgages and so on. When it comes to creating financial messes the Dems are in the middle of it!
I like to watch boxing, wrestling and underwater events.
Well, Los Angeles is home for me, love Long Beach. On a clear day in LA you can almost see half a mile!
California girls are hip!
The chimpanzee is real cute!
If you like to draw things, here is an example how to draw some basic shapes on wxPython's canvas:
# draw a few well known shapes on a wx.PaintDC() canvas
import wx
class MyFrame(wx.Frame):
def __init__(self, parent=None, title=None):
wx.Frame.__init__(self, parent, wx.ID_ANY, title)
self.panel = wx.Panel(self, size=(350, 450))
# this sets up the painting canvas
self.panel.Bind(wx.EVT_PAINT, self.on_paint)
# set frame size to fit panel
self.Fit()
def on_paint(self, event):
# establish the painting canvas
dc = wx.PaintDC(self.panel)
# draw some lines using the given pen specs
# from points (x1, y1) to (x2, y2)
x1 = 50
y1 = 20
x2 = 300
y2 = 20
# first pen colour is red (thickness = 5)
dc.SetPen(wx.Pen('red', 5))
dc.DrawLine(x1, y1, x2, y2)
# second pen colour is white
dc.SetPen(wx.Pen('white', 5))
dc.DrawLine(x1, y1+5, x2, y2+5)
# third pen colour is blue
dc.SetPen(wx.Pen('blue', 5))
dc.DrawLine(x1, y1+10, x2, y2+10)
# draw a red rounded-rectangle
# upper left corner coordinates x, y and width, height
# make the pen colour red (thickness = 1)
# default brush (fill) is white
dc.SetPen(wx.Pen('red', 1))
x = 50
y = 50
w = 100
h = 100
rect = wx.Rect(x, y, w, h)
# corners are quarter-circles using a radius of 8
dc.DrawRoundedRectangleRect(rect, 8)
# draw a red circle with yellow fill
# center coordinates x, y and radius r
dc.SetBrush(wx.Brush('yellow'))
x = 250
y = 100
r = 50
dc.DrawCircle(x, y, r)
# draw an arc from point x1, y1 to point x2, y2 counter
# clockwise along …
You can use several classes in your wxPython program. This example shows you how to cross reference a widget (or variable) from one class to another:
# experiments with wxPython, reference across class instances
# from one panel class to another panel class
import wx
import time
class MakePanel1(wx.Panel):
def __init__(self, Parent, *args, **kwargs):
wx.Panel.__init__(self, Parent, *args, **kwargs)
self.SetBackgroundColour('yellow')
self.label = wx.StaticText(self, -1, " panel1 label ")
self.hbox = wx.BoxSizer(wx.HORIZONTAL)
self.hbox.Add(self.label, 0, wx.ALL, 20)
self.SetSizer(self.hbox)
class MakePanel2(wx.Panel):
def __init__(self, Parent, *args, **kwargs):
wx.Panel.__init__(self, Parent, *args, **kwargs)
self.SetBackgroundColour('green')
self.button = wx.Button(self, label=" panel2 button ")
self.button.Bind(wx.EVT_BUTTON, self.buttonClick )
self.hbox = wx.BoxSizer(wx.HORIZONTAL)
self.hbox.Add(self.button, 0, wx.ALL, 20)
self.SetSizer(self.hbox)
def buttonClick(self, event=None):
# reference panel1's label via frame.panel1
s1 = "panel1 label ..... \n"
s2 = "the time is " + time.strftime("%H:%M:%S", time.localtime())
frame.panel1.label.SetLabel(s1 + s2)
class MakeFrame(wx.Frame):
def __init__(self, *args, **kwargs):
wx.Frame.__init__(self, *args, **kwargs)
self.panel1 = MakePanel1(self)
self.panel2 = MakePanel2(self)
vbox = wx.BoxSizer(wx.VERTICAL)
vbox.Add(self.panel1,1,wx.EXPAND);
vbox.Add(self.panel2,1,wx.EXPAND);
self.SetSizer(vbox)
# select a frame size so everything fits
self.Fit()
app = wx.App(0)
# instance frame is needed for later reference
frame = MakeFrame(None)
frame.Show(True)
app.MainLoop()
Main purpose is to learn how to better tailor targeted ads to you and yours. Now the possibilities for other uses are limitless, or I should say; limited only by their imagination. I leave to you to speculate who "they" are.
Could be George Bush's "National Spy Agency" run by the friendly folks at Blackwater USA?
Did you hear about the dyslexic devil worshipper?
He sold his soul to Santa.
If the #2 pencil is the most popular, why is it still #2?
Anyone who goes to a psychiatrist should have his head examined.
I like my own avatar the best! Who is jbennet anyway?
Professor SOS's avatar is rather cool though!
One day in 1936, the US state of Iowa (corn country) set a state record with a high temperature of 117 degrees Fahrenheit (47.3 degrees Celsius). Absolutely no one blamed it on global warming!
Here is a way to fill your full display screen with a wx.Frame() widget, that does not show a border nor a title bar. You have to give it an exit button of your own. To be mildly playful, lets cycle through the wxPython colour data base at random:
# a full screen-display wx.Frame without border and title bar
# wxPython's wx.lib.colourdb contains about 630 different
# colour names to cycle through at random
import wx
import random
import wx.lib.colourdb as cdb
class MyFrame(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, parent, wx.ID_ANY)
# create a full screen display frame, no title bar
self.ShowFullScreen(True, style=wx.FULLSCREEN_ALL)
w, h = wx.DisplaySize()
# create a panel to easily refresh colours
self.panel = wx.Panel(self, wx.ID_ANY, size=(w, h))
# supply an exit button in the upper right corner
self.exitbutton = wx.Button(self.panel, wx.ID_ANY, label='X',
pos=(w - 25, 5), size=(20, 15))
self.exitbutton.Bind(wx.EVT_BUTTON, self.exitbuttonClick)
cdb.updateColourDB()
# create a list of all the colours in the colour data base
self.colours = cdb.getColourList()
self.timer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.onTimer, self.timer)
# change colour every second (1000ms)
self.timer.Start(1000)
def onTimer(self, event):
bg = random.choice(self.colours)
#print bg # test
self.panel.SetBackgroundColour(bg)
self.panel.Refresh()
def exitbuttonClick(self, event):
self.Close(True)
app = wx.App(0)
MyFrame(None).Show(True)
app.MainLoop()
Write a program that generates acronyms, for instance it would turn the string "National Aeronautics and Space Administration" into NASA for short. Notice that words like "and", "the" are most often ignored
If list comprehension or generator expressions are not in your knowledge yet, maybe this is a little easier to understand:
def first_letters(s):
temp = ""
for letter in s.split():
temp += letter[0]
return temp
s = 'Old hero sleeps healthy in Thailand'
print first_letters(s)
A little bit more long winded, but using only very basic concepts:
def first_letters2(s):
space = " "
s = space + s
temp = ""
for k in range(len(s)):
if s[k] == space:
temp += s[k+1]
return temp
s = 'My mother used to bake apple pies in the foo bar'
print first_letters2(s)
A snake named Leptotyphlops carlae is smaller than any of the other 3,100 previously known snake species. It is about 4 inches long and a thin as spaghetti.
Like the dudes hairstyle!
Our phys-ed teacher has exactly this hairstyle!
Why is 'Microsoft Work' an oxymoron?
You might have to give us some more of your code. Don't be bashful!
This is an example how to create a wx.Frame() that fills the entire display screen:
# wx.DisplaySize() gives (width, height) tuple of your display screen
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY, pos=(0, 0),
size=wx.DisplaySize())
self.SetBackgroundColour('blue')
s = "Frame has full display size of %d x %d" % wx.DisplaySize()
self.SetTitle(s)
app = wx.App(0)
# instantiate class MyFrame and show
MyFrame().Show(True)
app.MainLoop()