Ene Uran 638 Posting Virtuoso

Use wxPython's wx.lib.dialogs.ScrolledMessageDialog() if you have to bring up a message box with a large amount of information:

# for a large information/message text uase wxPython's
# wx.lib.dialogs.ScrolledMessageDialog() widget

import wx
import wx.lib.dialogs

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

        # create an input widget
        self.button1 = wx.Button(self, wx.ID_ANY,
            label='The Zen of Python', pos=(10, 20))
        # bind mouse event to an action
        self.button1.Bind(wx.EVT_BUTTON, self.onAction)

    def onAction(self, event):
        """ some action code"""
        # pick an informative textfile you have in the
        # working directory (or use full path)
        fin = open("ZenPy.txt", "r")
        info = fin.read()
        fin.close()

        dlg = wx.lib.dialogs.ScrolledMessageDialog(self, info,
            "The Zen of Python, by Tim Peters ...")
        dlg.SetBackgroundColour('brown')
        dlg.ShowModal()


info_text = """\
The Zen of Python, by Tim Peters ...

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one, and preferably only one obvious way to do it.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea, let's do more of them!
"""

# create …
Ene Uran 638 Posting Virtuoso

Just an application for lambda, and the use of a dictionary to mimic C's switch/case statement:

# lambda creates an anonymous function
# returnedExpr must be an expression, not a statement
# this code could form a simple calculator

import math

def do_op(op, a=1, b=1):
    """use of a dictionary similar to C's switch/case"""
    return {
    '+': lambda: a + b,
    '-': lambda: a - b,
    '*': lambda: a * b,
    '/': lambda: a / b,
    '//': lambda: a // b,   # floor
    '**': lambda: a ** b,   # power
    'sin': lambda: math.sin(a),
    'cos': lambda: math.cos(a),
    'asin': lambda: math.asin(a),
    'acos': lambda: math.acos(a)
    }[op]()

# 355/113.0 pi approx.
print do_op('/', 355, 113.0)  # 3.14159292035

# sqroot(25)
print do_op('**', 25, 0.5)    # 5.0

# asin(sin(0.5))
print do_op('asin', do_op('sin', 0.5))  # 0.5
Ene Uran 638 Posting Virtuoso

Don't you folks listen to McCain?
The American economy is fundamentally strong!

Ene Uran 638 Posting Virtuoso

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

No wonder they taste sooo good!!!!

So this is why our local Walmart store pulled them all of the shelf.

Ene Uran 638 Posting Virtuoso

In the deep south, more than 50% of all bankruptcies are caused by non-payment of doctor/hospital bills!

Dito in the far west.

Ene Uran 638 Posting Virtuoso

Has anyone considered the consequences of putting this child Obama in the white house? I have heard some of the most idiotic and inept decision making in choosing thier candidates in my entire life. Mcain is sad as well, is this the best the republican party can come up with?!?! Obama is part of the freddy & fanny gang which broke this country. Does this matter to anyone?! He stands for nothing and lies about everything. The government in this country is so morally bankrupt its just sick and how anyone can tote a flag for any of these candidates needs to stop and think and do some research. Look at the people Obama looks up to and surrounds himself with. Character and associates matter greatly in a court of law so why should the same not apply with the leader of the country. Shame on everyone who casually tosses these gravely important issues aside and calls them "distractions". I am not voting for Mcain but against Obama. Its the lesser of the two evils. Age should not be an issue. Reagan never died, and how many heart attacks has Cheney had?

Well, we elected the child called George Bush twice. The child Obama is a heck of a lot smarter than him! Standing for nothing and lying about everything is standard operating procedure in American politics. Everybody in Washington had their hands in the freddy&fanny cookie jar.

Ene Uran 638 Posting Virtuoso

Just made the LA news:
A wealthy investor in San Fernando Valley killed his wife, mother, his 3 children and himself with a hand gun, because he lost all his money in the finance crisis.

Sad news, I guess to him money was all!

Ene Uran 638 Posting Virtuoso

This would be a typical Tkinter class creating what looks like a traffic light. I leave it up to you to assign the proper light actions.

# a simple Tkinter class

import Tkinter as tk

class TrafficLight(tk.Frame):
    """inherits tk.Frame"""
    def __init__(self, parent=None):
        tk.Frame.__init__(self, parent, bg='green')
        self.grid()
        # create a canvas to draw on
        self.cv = tk.Canvas(self, width=260, height=280, bg='white')
        self.cv.grid()

        self.make_widgets()

    def make_widgets(self):
        self.cv.create_rectangle(80, 20, 170, 260)
        # imagine a square box with
        # upper left corner coordinates x1, y1
        # lower right corner coordinates x2, y2
        # and sides of length span for each circle
        span = 50
        x1 = 100
        y1 = 50
        x2 = x1 + span
        y2 = y1 + span
        self.cv.create_oval(x1, y1, x2, y2, fill='red')
        self.cv.create_oval(x1, y1+70, x2, y2+70, fill='yellow')
        self.cv.create_oval(x1, y1+140, x2, y2+140, fill='green')


if __name__ == '__main__':
    light = TrafficLight()
    light.mainloop()
Ene Uran 638 Posting Virtuoso

Taking a look at wxPython's w.Image() widget, and how you can and could adjust the images red, green, blue and alpha content:

# experimants with wxPython wxImage(name, type)
# adjust the alpha (transparency) of an image
"""
type:
wx.BITMAP_TYPE_BMP  Load a Windows bitmap file
wx.BITMAP_TYPE_GIF  Load a GIF bitmap file
wx.BITMAP_TYPE_JPEG  Load a JPEG bitmap file
wx.BITMAP_TYPE_PNG  Load a PNG bitmap file
wx.BITMAP_TYPE_PCX  Load a PCX bitmap file
wx.BITMAP_TYPE_PNM  Load a PNM bitmap file
wx.BITMAP_TYPE_TIF  Load a TIFF bitmap file
wx.BITMAP_TYPE_XPM  Load a XPM bitmap file
wx.BITMAP_TYPE_ICO  Load a Windows icon file (ICO)
wx.BITMAP_TYPE_CUR  Load a Windows cursor file (CUR)
wx.BITMAP_TYPE_ANI  Load a Windows animated cursor file (ANI)
wx.BITMAP_TYPE_ANY  Will try to autodetect the format
"""

import wx

class ImagePanel(wx.Panel):
    """draw lines on a panel's wx.PaintDC surface"""
    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, .bmp image file)
        image_file = 'Pythonhand3.jpg'
        self.image= wx.Image(image_file, wx.BITMAP_TYPE_JPEG)
        image_width = self.image.GetWidth()
        image_height = self.image.GetHeight()
        # set frame size (also panel) to image size
        parent.SetClientSize((image_width+20, image_height+20))
        # call on_paint() to create the canvas
        wx.EVT_PAINT(self, self.on_paint)

    def on_paint(self, event):
        dc = wx.PaintDC(self)
        # reduces flicker
        #dc = wx.BufferedDC(dc)
        # set the background colour
        dc.SetBackground(wx.Brush("WHITE"))
        dc.Clear()
        # give it a pattern
        dc.SetBrush(wx.Brush("GREY", wx.CROSSDIAG_HATCH))
        windowsize= self.GetSizeTuple()
        dc.DrawRectangle(0, 0, windowsize[0], windowsize[1])

        # adjust r g b and alpha of image
        # AdjustChannels(fr, fg, fb, fa)
        # adjust the the red, green blue and alpha factors
        # from 0.0 to 2.0 to see …
Ene Uran 638 Posting Virtuoso

This is one way to create a wxPython canvas with a background pattern on it:

# the wx.PaintDC() surface is wxPython's canvas
# create a background pattern on the canvas

import wx

class ImagePanel(wx.Panel):
    """draw lines on a panel's wx.PaintDC surface"""
    def __init__(self, parent):
        wx.Panel.__init__(self, parent, wx.ID_ANY)

        wx.EVT_PAINT(self, self.on_paint)

    def on_paint(self, event=None):
        dc = wx.PaintDC(event.GetEventObject())
        # set the background colour
        dc.SetBackground(wx.Brush("WHITE"))
        dc.Clear()
        # give it a pattern using a brushed full sized rectangle
        dc.SetBrush(wx.Brush("LIGHT GREY", wx.CROSSDIAG_HATCH))
        windowsize= self.GetSizeTuple()
        dc.DrawRectangle(0, 0, windowsize[0], windowsize[1])

        # draw something cute
        for x in range(10, 180, 10):
            y = x
            r = x
            dc.SetPen(wx.Pen('red', 3))
            dc.DrawCircle(x, y, r)
            dc.SetPen(wx.Pen('blue', 3))
            dc.DrawSpline(((10, 200), (x, y), (2*x, 400-y), (370, 200)))


app = wx.App()
title = "A wx drawing surface with a background"
frame = wx.Frame(None, wx.ID_ANY, title, size=(380, 400))
ImagePanel(frame)
frame.Show(True)
app.MainLoop()
Ene Uran 638 Posting Virtuoso

Ene Uran,
Since you seems to have master down the "skill of analysis", could you give me, a mere ignorant unlearned in the ways of politics, a synopsis of the "new ideas" that Biden exposed on his behalf?

Old folks don't have new ideas! However Bob Barr, who is 59 at this point, is full of new ideas:
http://www.bobbarr2008.com/home/skip/?s=0618

Ene Uran 638 Posting Virtuoso

Try using this

if __name__ == '__main__':
     main()

That may help. I'm guessing you are familiar with it, and therefor i don't need to explain

Chris

That is used to test a module. Why would that help here, there isn't even a main()????

Ene Uran 638 Posting Virtuoso

Mushroom chicken on rice.

Ene Uran 638 Posting Virtuoso

Every morning I get up and look through the Forbes list of the richest people in America. If I'm not there, I go to work.

Ene Uran 638 Posting Virtuoso

Spanglish is a mix of Spanish and English that flows well when spoken. It is getting more and morer popular in the USA.

Ene Uran 638 Posting Virtuoso

The electric chair was invented by a dentist.

Ene Uran 638 Posting Virtuoso

Wonderful talent!

Ene Uran 638 Posting Virtuoso

Congratulations Grim and Henri, a fantastic accomplishment only a few posters have achieved! No wine for me, just a couple of microbrews.

Ene Uran 638 Posting Virtuoso

Governess Palin clearly won this debate. On top of that, she was expected to do poorly and she did darn well. She is a master debater, and can use about 10 basic sentences, mix them up properly and run a 90 minute debate with high skills.

Here are a few of her new ideas:

Washington wastes too much money, and she will change that!

She single-handedly will drill for more oil and gas to make America independent from all those Canadian imports.

America does not know how to win a war, she will change that.

Rich people know how to handle money best. Also, poor people just waste it, buying cheap Chinese goods and therefore sending jobs overseas.

Ene Uran 638 Posting Virtuoso

To keep related things together, you might want to check into a dictionary:

# here a,3  b,2  and   c,1 are related pairs
q = [['c', 'b', 'a'], ['1', '2', '3']]
d = dict(zip(*q))
print d  # {'a': '3', 'c': '1', 'b': '2'}

for key in sorted(d):
    print key, '-->', d[key]

"""
my output -->
a --> 3
b --> 2
c --> 1
"""
Ene Uran 638 Posting Virtuoso

Amongst other things, you can assign an image to wx.Brush(). Since the image is small, you can include it in the code as a base64 encoded image string. This has been done in previous sample codes in this thread, so here is a closer look at wxPython's canvas brush:

# a closer look at wx.Brush(colour, style=wx.SOLID)
# ene
"""
brush styles:
wx.TRANSPARENT       transparent (no fill)
wx.SOLID             solid (default)
wx.BDIAGONAL_HATCH   backward diagonal hatch
wx.CROSSDIAG_HATCH   cross-diagonal hatch
wx.FDIAGONAL_HATCH   forward diagonal hatch
wx.CROSS_HATCH       cross hatch
wx.HORIZONTAL_HATCH  horizontal hatch
wx.VERTICAL_HATCH    vertical hatch
wx.STIPPLE           stippled using a bitmap
wx.STIPPLE_MASK_OPAQUE  stippled using a bitmap's mask
"""

import wx
# to handle the base64 brush image
import cStringIO
import base64


class MyFrame(wx.Frame):
    def __init__(self, parent, title, data_stream):
        wx.Frame.__init__(self, parent, wx.ID_ANY, title, size=(370, 310))
        self.SetBackgroundColour('white')
        # convert data_stream to bitmap
        self.bmp = wx.BitmapFromImage(wx.ImageFromStream(data_stream))
        self.Bind(wx.EVT_PAINT, self.on_paint)

    def on_paint(self, event):
        # wx.PaintDC() creates a drawing canvas
        dc = wx.PaintDC(self)

        # wx.Brush(colour, style)
        dc.SetBrush(wx.Brush('red', wx.CROSS_HATCH))
        dc.DrawRectangle(10, 15, 90, 60)

        # wx.SOLID is the default style
        dc.SetBrush(wx.Brush('red', wx.SOLID))
        dc.DrawRectangle(130, 15, 90, 60)

        dc.SetBrush(wx.Brush('red', wx.BDIAGONAL_HATCH))
        dc.DrawRectangle(250, 15, 90, 60)

        dc.SetBrush(wx.Brush('red', wx.CROSSDIAG_HATCH))
        dc.DrawRectangle(10, 105, 90, 60)

        dc.SetBrush(wx.Brush('red', wx.FDIAGONAL_HATCH))
        dc.DrawRectangle(130, 105, 90, 60)

        dc.SetBrush(wx.Brush('blue', wx.HORIZONTAL_HATCH))
        dc.DrawRectangle(250, 105, 90, 60)

        dc.SetBrush(wx.Brush('blue', wx.VERTICAL_HATCH))
        dc.DrawRectangle(10, 195, 90, 60)

        dc.DrawRectangle(130, 195, 90, 60)
        dc.SetBrush(wx.Brush('yellow', wx.TRANSPARENT))
        dc.DrawRectangle(150, 205, 90, 60)

        # a way to set up a wall-papered background
        brush_bmp = wx.BrushFromBitmap(self.bmp)
        dc.SetBrush(brush_bmp)
        dc.DrawRectangle(250, 195, 90, 60)


# a base64 encoded image string
Lips_jpg_b64 = '''\
/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIf
IiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCIoOzs7Ozs7
Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCAAgADIDASIA
AhEBAxEB/8QAGwAAAQUBAQAAAAAAAAAAAAAABgADBAUHAQL/xAAvEAABBAAGAQMCBAcAAAAAAAAB
AgMEEQAFBhIhMUETIlEUYUJxkfAVIyQyUoGh/8QAGAEAAwEBAAAAAAAAAAAAAAAABAUGAwL/xAAn
EQABAwIEBQUAAAAAAAAAAAABAAIDBBEFEzFBEiFRgdEiMmFxkf/aAAwDAQACEQMRAD8AMsUWaapY
iPuQ4jLkmUkhNpSS2hRvhRHPABNAeK+ajap1KzBSrL48hTcoqAdUlJHpoNE+7wSD2Aa/OsZ29MbS
N7jh3klSlLPf75/XAk05B4WKgw7DGPbnVHIbDTv9ItXrDMg26oy4u5S1BpDTR4TsUAqyDQ3AEAiy
e6Haka1zVxCAgRoyHUinUIKyhQ4N3x2LqiQFDs9ikJv+JV6eYZdGQeSuXLQ2Oz+G918fH3+Lso+l
80zFt9zK5mUziwfciNLKlXzXgDmjV1eMRnpi52GAgWBt8eNUTRdXy47rYmttymFBe1cdshxaUi/U
omqPN9VSuttYLI0lmZHRIjuBxpwWlQ84yKY1OyOWhE9kRZC+Wj6oJBSRyCkmj+/vi40zqZOVvIZd
IRDWv+YEoKuard3fYHXdn7Y7jmc02eh6vDoJ4zJS2uNhv26rScLHELQ4hLjagtCgClSTYI+RhYOU
togXWejlSXnc0g/ULU6pIcYZHR6KwAefFiibJN4DY2SZdIoSJL/CLKlELCiLPHIrigO+cbbgXzHQ …
Ene Uran 638 Posting Virtuoso

Just some fun with colours, using wxPython's wx.PaintDC() canvas and dc.GradientFillLinear(). Can be used as a gradient background and so on:

# using dc.GradientFillLinear() on a wxPython canvas
# cosmetic but fun

import wx

class MyFrame(wx.Frame):
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, wx.ID_ANY, title, size=(300, 300))
        self.SetBackgroundColour('#FFE4C4')   # bisque
        self.Bind(wx.EVT_PAINT, self.on_paint)

    def on_paint(self, event):
        dc = wx.PaintDC(self)

        # wx.Rect(x, y, w, h)
        # basic rectangle for all rectangles
        rect = wx.Rect(0, 0, 250, 50)

        rect.SetPosition((20, 20))
        dc.GradientFillLinear(rect, 'blue', 'white', wx.NORTH)
        dc.DrawText("blue to white going north", 30, 40)
        rect.SetPosition((20, 80))
        dc.GradientFillLinear(rect, 'blue', 'white', wx.SOUTH)
        rect.SetPosition((20, 140))
        dc.GradientFillLinear(rect, 'blue', 'yellow', wx.WEST)
        dc.DrawText("blue to yellow going west", 30, 160)
        rect.SetPosition((20, 200))
        dc.GradientFillLinear(rect, 'blue', 'yellow', wx.EAST)

        # pretty much froms a horizontal line
        rect = wx.Rect(0, 0, 250, 5)
        rect.SetPosition((20, 10))
        dc.GradientFillLinear(rect, 'red', 'green', wx.WEST)
        rect.SetPosition((20, 255))
        dc.GradientFillLinear(rect, 'red', 'green', wx.EAST)


app = wx.App(0)
MyFrame(None, 'dc.GradientFillLinear()').Show()
app.MainLoop()
Ene Uran 638 Posting Virtuoso

Zoe's bar graph example made me look a little closer at wx.Pen() -->

# the wx.PaintDC surface is wxPython's drawing canvas
# a closer look at wx.Pen(colour, width=1, style=wx.SOLID)
"""
pen styles:
wx.SOLID
wx.DOT
wx.LONG_DASH
wx.SHORT_DASH
wx.DOT_DASH
wx.TRANSPARENT

SetJoin style options:
wx.JOIN_MITER  --> default
wx.JOIN_BEVEL
wx.JOIN_ROUND

SetCap style options:
wx.CAP_ROUND
wx.CAP_PROJECTING
wx.CAP_BUTT  --> default
"""

import wx

class MyFrame(wx.Frame):
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, wx.ID_ANY, title, size=(400, 300))
        self.SetBackgroundColour('white')
        self.Bind(wx.EVT_PAINT, self.on_paint)

    def on_paint(self, event):
        "create the canvas and draw on it"
        dc = wx.PaintDC(self)

        # wx.Pen(colour, width, style)
        # wx.SOLID is actually the default
        pen = wx.Pen('blue', 10, wx.SOLID)

        pen.SetJoin(wx.JOIN_MITER)
        dc.SetPen(pen)
        dc.DrawRectangle(10, 10, 110, 70)
        dc.DrawText('JOIN_MITER', 20, 20)

        pen.SetJoin(wx.JOIN_BEVEL)
        dc.SetPen(pen)
        dc.DrawRectangle(140, 10, 110, 70)
        dc.DrawText('JOIN_BEVEL', 150, 20)

        pen.SetJoin(wx.JOIN_ROUND)
        dc.SetPen(pen)
        dc.DrawRectangle(270, 10, 110, 70)
        dc.DrawText('JOIN_ROUND', 280, 20)

        # comes in handy if you want to use thick lines
        # for instance for a bar graph
        pen.SetCap(wx.CAP_BUTT)
        dc.SetPen(pen)
        dc.DrawLine(30, 150,  150, 150)
        dc.DrawText('CAP_BUTT', 170, 140)

        pen.SetCap(wx.CAP_PROJECTING)
        dc.SetPen(pen)
        dc.DrawLine(30, 190,  150, 190)
        dc.DrawText('CAP_PROJECTING', 170, 180)

        pen.SetCap(wx.CAP_ROUND)
        dc.SetPen(pen)
        dc.DrawLine(30, 230,  150, 230)
        dc.DrawText('CAP_ROUND', 170, 220)

        # base lines
        pen2 = wx.Pen('red')
        dc.SetPen(pen2)
        dc.DrawLine(30, 130, 30, 250)
        dc.DrawLine(150, 130, 150, 250)
        dc.DrawLine(155, 130, 155, 250)


app = wx.App(0)
MyFrame(None, 'wx.Pen() options').Show()
app.MainLoop()
Ene Uran 638 Posting Virtuoso

login='***
should be
login='***'

Ene Uran 638 Posting Virtuoso

I played around with the wx.MiniFrame() widget that brings up a simpler frame. To make it do something useful I added the LEDNumberCtrl and made it a digital clock:

# use wxPython's wx.MiniFrame(), wx.gizmos.LEDNumberCtrl() and
# wx.Timer() to create a digital LED 24 hour clock

import wx
import wx.gizmos
import time

class MyMiniFrame(wx.MiniFrame):
    def __init__(self, parent, mytitle, mysize):
        wx.MiniFrame.__init__(self, parent, wx.ID_ANY, mytitle,
            size=mysize, style=wx.DEFAULT_FRAME_STYLE)

        self.led = wx.gizmos.LEDNumberCtrl(self, wx.ID_ANY,
            style=wx.gizmos.LED_ALIGN_CENTER)  #, pos, size, style)
        # default colours are green on black
        self.led.SetBackgroundColour("blue")
        self.led.SetForegroundColour("yellow")
        # start right away
        self.onTimer(None)
        # then let the timer kick in
        self.timer = wx.Timer(self, wx.ID_ANY)
        # update clock digits every second (1000ms)
        self.timer.Start(1000)
        self.Bind(wx.EVT_TIMER, self.onTimer)

    def onTimer(self, event):
        # get current time from your computer
        current = time.localtime(time.time())
        # time string can have characters 0..9, -, period, or space
        ts = time.strftime("%H-%M-%S ", current)
        self.led.SetValue(ts)


app = wx.App(0)
# create a MyMiniFrame instance and then show the frame
mframe = MyMiniFrame(None, 'a digital led clock', (350, 100))
mframe.Show()
app.SetTopWindow(mframe)
app.MainLoop()
Ene Uran 638 Posting Virtuoso

If a deaf person has to go to court, is it still called a hearing?

Ene Uran 638 Posting Virtuoso

Danny Funderbunk, the ultra brave mayor of Fort Mill, South Carolina, has been very busy forwarding everybody emails about whether that colored fellow Barack Obama is perhaps some creature sent by the Devil to have a mythological war with Jesus, you know, perhaps he may just be the Anti-Christ!

Ene Uran 638 Posting Virtuoso

Sarah Palin is a great Christian. She created an official Christian Heritage Week in the state of Alaska. God wants her to be the future US president.

Ene Uran 638 Posting Virtuoso

Do I need a college degree to be considered?

It most certainly will help!

Ene Uran 638 Posting Virtuoso

._._.
Sarah Palin: Bad for America, bad for wildlife, bad for your 401K.

Come on, show some respect to this wonderful person! She is Governor of the largest state in the USA! She knows more about finance and energy then the entire congress combined. Best of all, she is one heck of a maverick and has quite a bit of energy herself.

Ene Uran 638 Posting Virtuoso

Did you hear about the shoe factory that burned down?

Over a thousand soles were lost.

Ene Uran 638 Posting Virtuoso

George W. Bush, Fort Sam Houston, TX 1/1/2006:
"There is an enemy out there. They read newspapers."

Just a few more weeks and he will exit the stage. He has brought so many fresh ideas to the English language and to the rules of the land. I will miss him dearly. Kissy, kissy George!

Ene Uran 638 Posting Virtuoso

I really enjoy Python, take a look at:
http://bembry.org/technology/python/StartProgramming.pdf
and:
http://www.daniweb.com/forums/thread20774.html

The whole Python package is open source and free from Python.org. If you decide to get Python, download the Windows installer package (.msi) of version 2.5 or 2.6. Stay away from version 3.0 since it will make a few changes to the syntax and is not in its stable production release yet. The Python forum at Daniweb is quite active and somebody is always ready to help.

Ene Uran 638 Posting Virtuoso

Don't worry about those folks, they will get a slap on the wrist at the most. Just like Neil Bush, Charles Keating and John McCain got on the Savings and Loan scandals a few years back.

Remember that turd floats!

Ene Uran 638 Posting Virtuoso

I think Ike should have snowed itself out of existence near the North Pole by now, giving Santa some much needed white fluff.

Ene Uran 638 Posting Virtuoso

Interesting: Burning the Tide

Very good article Dave, thanks! Clean energy in the future will have to come from wind, wave, solar and bio. Ultimately they are all effects of the sun.

Ene Uran 638 Posting Virtuoso

I looked up Hoover Dam, it has a capacity of 2,000,000 kw and could potentially charge 40,000 electric cars.

You need to add "at any given time"

Ene Uran 638 Posting Virtuoso

2gigawatts per ??.

Good grief, even I know that a watt is the product of voltage and current at any given time. No need to have a per there.

Ene Uran 638 Posting Virtuoso

Thought I'd take a risk with my pulled tooth and eat a small bag of pretzels. Yeah, takin a walk on the wild side. Delicioso!!!

Let me warn you, George Bush ate one of those, choked and fell over hurting himself badly. He hated the Germans ever since!

I have been avoiding any food from China to the point where I don't even go to one of many Chinese retaurants here. I figure they are the places that most likely import such food. Killing all those babies with their contaminated babyfood is just horrible!

Ene Uran 638 Posting Virtuoso

woooee is correct, it is the line endings. You can look at the files with a hexeditor and find that Windows uses "\n\r" or hex '0d 0a', Linux uses "\n" or hex '0d' and the Mac uses "\r" or hex '0a'. So much for a standard!

Windows will accept the Linux ending but not the Mac ending.

Ene Uran 638 Posting Virtuoso

Why do all the extra work, if Python can do it for you?

result3=[
83,97,109,117,101,108,32,83,109,105,116,104,13,10,13,10,84,
104,97,110,107,32,121,111,117,32,102,111,114,32,108,111,111,
107,105,110,103,32,116,104,101,32,111,116,104,101,114,32,119,
97,121,32,111,110,32,116,104,101,32,105,110,99,114,101,97,115,
101,100,32,108,101,118,101,108,115,32,111,102,32,116,111,120,
105,99,32,99,104,101,109,105,99,97,108,115,32,105,110,32,116,104,
101,32,114,105,118,101,114,32,114,117,110,110,105,110,103,32,97,
108,111,110,103,115,105,100,101,32,109,121,32,104,111,109,101]

# show the text hidden in the list of ascii values
print "".join([chr(x) for x in result3])

I know, I know, not as much fun as the long way!

jlm699 commented: Sexy, simple method +1
Ene Uran 638 Posting Virtuoso

This year alone over 6,000 Americans have gone to hospital emergency rooms with injuries resulting from opening the ever so popular (at least with the stores) rigid 'clamshell' packaging.

Ene Uran 638 Posting Virtuoso

How would you program a voting system in Python that would allow the typical uneducated voter to vote and yet be secure to fraud by dead voters and such?

Ene Uran 638 Posting Virtuoso

I doubt that Palin would/could be any worse than Bush.

Ene Uran 638 Posting Virtuoso

700 Billion Dollars with no strings attached.
More giant taxbreaks.
Easier ways to send my loot to the Caymen Island Banks.
Politicians that give discounts to frequent influence buyers.

Hey Zoe, let me know if you get the stuff! I would be happy with just 1% (7 Billion Dollars) of the handout.

Ene Uran 638 Posting Virtuoso

I think the wholesale fraud comes after you elected an official and he/she gets exposed to a hall full of lobbyists.

Ene Uran 638 Posting Virtuoso

if you open the file with "r" you get:
'str' object does not support item assignment
if you open the file with "rb" you get:
Insecure string pickle

Somehow the new.txt file must be corrupted or used a strange dump() protocol.

Ene Uran 638 Posting Virtuoso

Pork is good, war is bad!

Ene Uran 638 Posting Virtuoso

I wonder if all those annoying Cirtcuit City popups on DaniWeb are considered spamming?

Ene Uran 638 Posting Virtuoso

UU:
"I'm thrilled to be here in the bread basket of America because it gives me a chance to remind our fellow citizens that we have an advantage here in America -- we can feed ourselves."