ZZucker 342 Practically a Master Poster

Greek yogurt with blueberries, glass of milk.

ZZucker 342 Practically a Master Poster

Wonder Woman

ZZucker 342 Practically a Master Poster

I love yogurt, particularly Greek yogurt!

I agree that most newscasters need stuff thrown at them, but why waste good yogurt?

ZZucker 342 Practically a Master Poster

Time just keeps on going! Procrestinate now and slow it down a little!

ZZucker 342 Practically a Master Poster

Sooner or later all cars will run electric, then we will have to post a new thread called
"Kilowatthour Prices"

ZZucker 342 Practically a Master Poster

To run a timer in the background you have to use the module threading.
You can also use the current time at start and end of the game and calculate the difference.

time elapsed using time.clock() or time.time():
 import time



# time.clock() is for windows only, updates every 1 ms
start = time.clock()

# your program code here ...

# for instance this demo code will take about 7.5 seconds
print "going"
time.sleep(2.5)  # 2.5 seconds
print "still going"
time.sleep(2.5)
print "still going"
time.sleep(2.5)
print "done"


# ... your program ends
end = time.clock()
print "Time elapsed = ", end - start, "seconds"
vegaseat commented: that's it +14
ZZucker 342 Practically a Master Poster

Select multiple items from a Tkinter list box:

# a simple Tkinter Listbox example
# press the shift or ctrl key to select multiple items

try:
    # for Python2
    import Tkinter as tk
except ImportError:
    # for Python3
    import tkinter as tk


def get_list():
    """
    function to read the listbox selection(s)
    (mutliple lines can be selected)
    and put the result(s) in a label
    """
    # tuple of line index(es)
    sel = listbox.curselection()
    # get the text, might be multi-line
    seltext = '\n'.join([listbox.get(x) for x in sel])
    label_text.set(seltext)

root = tk.Tk()
# used for label text
label_text = tk.StringVar(root)

# extended mode allows CTRL or SHIFT mouse selections
listbox = tk.Listbox(root, selectmode=tk.EXTENDED)
listbox.pack()

# click the button to show the selection(s)
button = tk.Button(root, text="Get Selection(s)", command=get_list)
button.pack()

# used to display selection(s)
label = tk.Label(root, textvariable=label_text)
label.pack()

# load some datalines into the listbox
items = ["one", "two", "three", "four", "five", "six"]
for item in items:
    listbox.insert(tk.END, item)

# highlight/preselect line 3 of listbox (starts with zero)
# lb.selection_set(first, last=None) can preselect more than 1 line
listbox.selection_set(3)

root.mainloop()
ZZucker 342 Practically a Master Poster

Use some of the financial formulas found at
http://www.math4finance.com/financial-formulas.php
to write Python programs to get monthly payment schedules,
future and present values, payment calculations and due dates.

ZZucker 342 Practically a Master Poster

Note that Portable Python does not use the Windows Registry, after all it is supposed to be portable.

ZZucker 342 Practically a Master Poster

Okay, I downloaded
PortablePython3.2.1.1.exe
from
http://www.portablepython.com/wiki/PortablePython3.2.1.1
and installed it on my C: drive

Now you can run the excellent IDE (a Python editor)
PyScripter-Portable
which is located in directory
C:\Portable Python 3.2.1.1

From the PyScripter's File Explorer (on the left side of the IDE) you can load
yinyang.py
from directory
C:\Portable Python 3.2.1.1\App\Lib\turtledemo
and run it from the IDE directly. Works great for me.

ZZucker 342 Practically a Master Poster

Here is an example how to use the module pickle:

# use module pickle to save/dump and load a dictionary object
# or just about any other intact object
# use binary file modes "wb" and "rb" to make it work with
# Python2 and Python3

import pickle

# create the test dictionary
before_d = {}
before_d[1]="Name 1"
before_d[2]="Name 2"
before_d[3]="Name 3"

# pickle dump the dictionary
fout = open("dict1.dat", "wb")
# default protocol is zero
# -1 gives highest prototcol and smallest data file size
pickle.dump(before_d, fout, protocol=0)
fout.close()

# pickle load the dictionary
fin = open("dict1.dat", "rb")
after_d = pickle.load(fin)
fin.close()

print( before_d )  # {1: 'Name 1', 2: 'Name 2', 3: 'Name 3'}
print( after_d )   # {1: 'Name 1', 2: 'Name 2', 3: 'Name 3'}
ZZucker 342 Practically a Master Poster

I can't find file turtleDemo.py in the Python32 installation. If you have it from older installations you might try to change
import Tkinter
to
import tkinter

In your file manager double click on one of the python source files (have extension .py) in directory
C:\Python32\Lib\turtledemo
for instance
yinyang.py

You can also run this batch file
C:\Python32\python -u C:\Python32\Lib\turtledemo\yinyang.py

Or simply use the Python editor IDLE, load the source code file and run the module.

ZZucker 342 Practically a Master Poster

Something like this will do:

def hide_word(word):
    """hide word as whitespace like tabs"""
    temps = ""
    tab = '\t'
    new_line = '\n'
    for letter in word:
        # 'A' would be 1 tab, 'B' 2 tabs etc.
        temps += tab * (ord(letter) - 64) + new_line
    return temps


text = "My name is "
hide = "Bob"

new_text = text + hide_word(hide)


# test
print('-'*60)
print(new_text)
print('-'*60)
# unhide
nt = 0
temps = ""
for c in new_text:
    if c == '\t':
        #print('|')
        nt += 1
    elif c == '\n':
        temps += chr(nt + 64)
        nt = 0
    else:
        temps += c
        nt = 0

print(temps)
ZZucker 342 Practically a Master Poster
ZZucker 342 Practically a Master Poster

Never knew you even existed.
You latest avatar sound a bit childish, how old are you?

ZZucker 342 Practically a Master Poster

Salmon over spinach and rice. Glass of soy milk.

ZZucker 342 Practically a Master Poster

Radish sprouts are popular in Japan. In 1996 there was an E. coli outbreak that killed 12 people and reportedly sickened more than 12,000 others. Commercially these sprouts are grown at about 100 degree F (38 degree C), a temperature ideal for the growth of E. coli bacteria.

ZZucker 342 Practically a Master Poster

Another reference to Python games using AI:
http://inventwithpython.com/chapter16.html

ZZucker 342 Practically a Master Poster

Compare module re (regex) with some of the Python builtin string functions.

For instance:

import re

# wisdom from Mark Twain
text = '''
When your friends begin to flatter you on how young
you look, it's a sure sign you're getting old.
'''

searched = re.search("flat", text)
if searched.group(0):
    print("found '%s'" % searched.group(0)) 
    start, end = searched.span()
    print("at text index start = %d, end = %d" % (start, end))

""" my result is >>
found 'flat'
at text index start = 28, end = 32
"""

Python has a function find() that would work similarly.

What would you do if the text had several sub-strings you were searching for?

ZZucker 342 Practically a Master Poster

Extra dark chocolate

ZZucker 342 Practically a Master Poster

Rich folks make tons of money the easy way by investing with insider information from their CEO buddies.

ZZucker 342 Practically a Master Poster

John Davison

ZZucker 342 Practically a Master Poster

Cooking

ZZucker 342 Practically a Master Poster

Spinach Lasagna, and Spumoni

ZZucker 342 Practically a Master Poster

For the basics of a Koch snowflake see:
http://ecademy.agnesscott.edu/~lriddle/ifs/ksnow/ksnow.htm

ZZucker 342 Practically a Master Poster

If you never take off, you will never fly high!

ZZucker 342 Practically a Master Poster

Lis travel faster because they are easier to generate. To establish the truth to confront these lies takes longer. A fact often abused in politics.

ZZucker 342 Practically a Master Poster

Eureka, I have reached my number 666 post at glorious Daniweb!

It's exactly 666 now, but will of course increase as I post more!

ZZucker 342 Practically a Master Poster

Well, there is good news for the warhawksWe have officially entered Syria with a helicopter and commandos - is the October Surprise we have been waiting for?

See, I told you that Bush/McCain have something up their sleves to win the election! Maybe Osama is secretly hiding out or plans to hide out in Syria.

ZZucker 342 Practically a Master Poster

Yeah, the credit card, a necessary evil, always use it, but also always pay it up in time. I have plenty of foolish friends who spend half their income on cedit card interest. Some of those cards make a loan shark look friendly! Also remember that Joe Biden was behind much of the legislation making this possible.

ZZucker 342 Practically a Master Poster

yeah well we have kind of failed afghanistan, i mean, after 8 years we STILL havent found Osama.

McCain in one of the debates claimed he knows exactly how to catch Osama, all we have to do is to let him be our president. I believe him.

ZZucker 342 Practically a Master Poster

i mean the wars in Afghanistan and Iraq

Don't you listen to McCain? These wars are won! He is a military expert! Just a matter of cleaning up some messes.

ZZucker 342 Practically a Master Poster

Ever stumbled over silly instructions?

Open Packet, Eat Nuts

To avoid breakage, keep bottom on top.
Top marked bottom to avoid confusion.

ZZucker 342 Practically a Master Poster

jbennet, you are simply exceptional!

Remember half the people you know are below average.

ZZucker 342 Practically a Master Poster

Picked from newspaper classifieds:

'83 Toyota hunchback -- $2000

Just in time for deer season:
2 wire mesh butchering gloves, one 5-finger, one 3-finger, pair only $15

Bill's septic cleaning "We haul American made products"

Our sofa seats the whole mob and is made of 100% Italian leather.

Joining nudist colony, must sell washer & dryer, asking $300.

Christmas Sale of Methodist Women at West-Side Church.

FOR SALE BY OWNER Complete set of Encyclopedia Britannica. 45 volumes. Excellent condition. Asking $1,000.00 or best offer. No longer needed. Got married last weekend. Wife knows everything.

ZZucker 342 Practically a Master Poster

Just an accumulation of funny news lines:

Governor Chiles Offers Rare Opportunity To Goose Hunters (The Tallahassee Democrat)

Gators To Face Seminoles With Peters Out (The Tallahassee Bugle)

Messiah Climaxes In Chorus Of Hallelujahs (The Anchorage, Alaska Times)

Textron Inc. Makes Offer To Screw Company Stockholders (The Miami Herald)

Something Went Wrong in Jet Crash, Experts Say

Include Your Children When Baking Cookies (LA Times)

Kids Make Nutritious Snacks

Iraqi Head Seeks Arms (NY Times)

Miners Refuse to Work After Death (WV Herald)

Typhoon Rips through Cemetery; Hundreds Dead

The streets are safe in Philadelphia.
It's only the people who make them unsafe.

ZZucker 342 Practically a Master Poster

A man decided to have a face lift for his birthday. He spends $5,000 and feels really great about the result. On his way home he stops at a newsstand and buys a paper. Before leaving he says to the sales clerk, "I hope you don't mind me asking, but how old do you think I am?" "About 35," was the reply.

"I'm actually 47," the man says, feeling really happy.

After that he goes into McDonalds for lunch, and asks the order taker the same question, to which the reply is, "Oh you look about 29".

"I am actually 47!" This makes him feel really good.

While standing at the bus stop he asks an old woman the same question. She replies, "I am 85 years old and my eyesight is going. But when I was young there was a sure way of telling a mans age. If I put my hand down your pants for one minute I will be able to tell your exact age."

As there was no one around, the man thought what the hell and let her slip her hand down his pants. One minute later the old lady says, "OK, it's done. You are 47."

Stunned the man says, "That was brilliant! How did you do that?"

The old lady replies, "I was in line behind you at McDonalds."

ZZucker 342 Practically a Master Poster

I've taken a vow of poverty. To annoy me, send money.

ZZucker 342 Practically a Master Poster

Life is sexually transmitted.

ZZucker 342 Practically a Master Poster

As long as there are tests, there will be prayer in public schools.

ZZucker 342 Practically a Master Poster

Where there's a will ... I want to be in it.

ZZucker 342 Practically a Master Poster

Honk if you love peace and quiet.

ZZucker 342 Practically a Master Poster

A warning to witches everywhere, don't drink and fly!

ZZucker 342 Practically a Master Poster

Killing an enemy with your gun would be very patriotic I think!

ZZucker 342 Practically a Master Poster

The national debt is small for a wealthy country like the USA! BTW, why shouldn't our children and grandchildren pay for the debt, after all most of it was accumulated to beat our enemies and make their future better and free.

ZZucker 342 Practically a Master Poster

Why don't you put a few test printf's in to see what's going on.

ZZucker 342 Practically a Master Poster

>>Make sure that every child has a father.
How is she going to do that??? Of course every child has a father -- I don't think its yet possible for a woman to make a baby by herself and without the help of some man.

By giving incentives to the father of the child to marry the mother.

ZZucker 342 Practically a Master Poster

According to Joe Lieberman, who has been training Sarah, she is a very smart student and learns quickly. He is convinced that she will pull an election day win for his buddy McCain.

ZZucker 342 Practically a Master Poster

Polls show that the Palin/McCain ticket is closing the gab rapidly and Obama is only a few percent ahead now. This is largely due to voters discovering that Sarah Palin has a heart of gold and means what she says.

She protects the unborn.
She will bring back family values.
Make sure that every child has a father.
She will not take away our guns.
She is pro Christianity.
She supports the all important creation approach.
She will ban witchcraft.
She will not tax away your wealth.
Enemies of the US better be worried.
Countries that are not with us will suffer.
She will get and kill Osama.
She will make hockey the true American sport it is.

Ezzaral commented: Hehehe, quite amusing :) +13
ZZucker 342 Practically a Master Poster

Scary things other than creationism:

Bloodshed - where the Red Cross keeps the plasma

Cemetary - bone zone.

Headline: "Due to strike, grave-digging at cemetary will be done by skeleton crews"