ZZucker 342 Practically a Master Poster

New words:

tup = ('ello World','uello World')
print('\n'.join(chr(n)+tup[chr(n)=='Q']for n in range(66, 91)))
ZZucker 342 Practically a Master Poster

Your code tells me that you are using Python2.

Where is your start?

ZZucker 342 Practically a Master Poster

Creative answering machine messages:

"You have reached the CPX-2000 Voice Blackmail System. Your voice
patterns are now being digitally encoded and stored for later use. Once this is
done, our computers will be able to use the sound of YOUR voice for
literally thousands of illegal and immoral purposes. There is no charge
for this initial consultation. However, our staff of professional
extortionists will contact you in the near future to further explain the
benefits of our service, and to arrange for your schedule of payments.
Remember to speak clearly at the sound of the tone. Thank you."

ZZucker 342 Practically a Master Poster

I gave enki a try, but it failed the simple name = input("Enter your name: ") test using it on Python34 and Windows7.

ZZucker 342 Practically a Master Poster

"If your bank uses Java applets, you should not use their online banking system at all, especially not under Windows."
-- Mike

How do you find out if your bank uses Java applets?

ZZucker 342 Practically a Master Poster

Just survived the "Pineapple Express" that gave large parts of California nine inches of rain.

ZZucker 342 Practically a Master Poster

I just had a taste of Starbucks Holiday Blend coffee, real good stuff.

ZZucker 342 Practically a Master Poster

Don't you feel important with all those emails?

ZZucker 342 Practically a Master Poster

My guess is that the folks at Sony wish they used ProtonMail.

ZZucker 342 Practically a Master Poster

When I was in Mumbai, India recently, I saw a sign on a vehicle that said, 'English speaking taxi driver'.

I thought to myself,
"What a wonderful idea. Why don't we have them in London, England?"

ZZucker 342 Practically a Master Poster

An application was for employment
A program was a TV show
A cursor used profanity
A keyboard was a piano.

Memory was something that you lost with age
A CD was a bank account
And if you had a 3-inch Floppy
You hoped nobody found out.

Compress was something you did to the garbage
Not something you did to a file
And if you unzipped anything in public
You'd be in jail for a while.

Log on was adding wood to the fire
Hard drive was a long trip on the road
A mouse pad was where a mouse lived
And a backup happened to your commode.

Cut you did with a pocket knife
Paste you did with glue
A web was a spider's home
And a virus was the flu.

ZZucker 342 Practically a Master Poster

I am not sure why science has such a bad stigma amongst US teenagers. Maybe because our only heroes are military or sports/entertainers.

ZZucker 342 Practically a Master Poster

Windows 10 will have to be successful since about 90% of desktop and laptop computers worldwide use Windows. Apple iOS/OSX follows with 7% and Linux with about 2%. I doubt that many of those Windows users will switch and waste their time learning a different OS.

Servers are also dominated by Windows with 56%, followed by Linux with 20% and iOS/OSX with 18%.

When it comes to tablets and phones, Microsoft missed the boat. Android and iOS/OSX are king.

Linux rules the supercomputer world.

http://en.wikipedia.org/wiki/Usage_share_of_operating_systems

ZZucker 342 Practically a Master Poster

Oh wow, I didn't know about the magic dragon's demise. What a tragedy!

ZZucker 342 Practically a Master Poster

Microsoft is "too big to fail". Just like the big banks, the US taxpayer would have to bail them out. Without Windows the whole governmental bureaucracy would be in jeopardy.

ZZucker 342 Practically a Master Poster

A code snippet is an example of working code that brings up an interesting aspect of Python programming. An English language string is given and then tanslated into several other languages. The translated string is printed out. You could apply the concept to one of your programs.

You need to learn the basics of Python first to start to understand what is going on.

ZZucker 342 Practically a Master Poster

A look at module fractions:

import fractions
import math

fractional_pi = fractions.Fraction(str(math.pi))

# limit the denominator to 999 or less
fractional_pi_999 = fractional_pi.limit_denominator(999)

# show result
sf = "pi = {} as a fraction with a max. denominator of 999 is {}"
print(sf.format(math.pi, fractional_pi_999))

''' my result -->
pi = 3.14159265359 as a fraction with a max. denominator of 999 is 355/113
'''
ZZucker 342 Practically a Master Poster

McDonalds has sold so many hamburgers that if you lined them up side by side you could go around the world 52 times. Then with what's left stack them up to the moon and back.

ZZucker 342 Practically a Master Poster

Strassburger Leberwurst on a potato bagel, and cool mango lemonade.

ZZucker 342 Practically a Master Poster

The integral from -infinity to infinity of e^(-x^2) is sqrt(pi).

"Heads, she wins! Tails, you lose!"

¿umop apisdn upside down?

ZZucker 342 Practically a Master Poster

You might have to update/refresh self.getControl

ZZucker 342 Practically a Master Poster

Writing your own IDE, here is a hint on how to do this sort of thing:
http://www.daniweb.com/software-development/python/code/445504/an-almost-ide-wxpython

I would use the PySide GUI toolkit, since wxPython is a mess with Python3.

ZZucker 342 Practically a Master Poster

The Eric IDE is full featured and written in Python:
http://eric-ide.python-projects.org/

For a beginner the nimble IDLE that comes with your Python installation is probably best.

ZZucker 342 Practically a Master Poster

In your case def print_func( par ): argument par could have other more decriptive names, just make sure you don't use builtin Python function names.

For guidelines on writing Python code see:
http://docs.activestate.com/activepython/2.5/peps/pep-0008.html

ZZucker 342 Practically a Master Poster

One way would be to use the function's documentation string to do this.

ZZucker 342 Practically a Master Poster

Actually using string formatting would be the most pythonic way:

num1 = int(raw_input("Enter an integer"))
num2 = int(raw_input("Enter a second integer"))
num3 = int(raw_input("Enter a third integer"))
ans = num1 + num2 + num3
print("The sum of the 3 integers entered is {}".format(ans))
ZZucker 342 Practically a Master Poster

http://www.daniweb.com/software-development/python/threads/20774/starting-python/19#post2091746

For me Eclipse is woefully sluggish and bloated, since it is written in Java.

Python comes in two major versions and it is nice to be able to run both versions from the same IDE.

ZZucker 342 Practically a Master Poster

To get more information on par you can do this:

# Importing support.py module 

import support
support.print_func("Zara")

# to get more insight ...
import inspect
print(inspect.getcallargs(support.print_func, "Zara"))

''' result ...
Hello :  Zara
{'par': 'Zara'}
'''
Gribouillis commented: nice! +14
ZZucker 342 Practically a Master Poster

pytony, red is a nice color

ddanbe commented: Keen eye! +15
ZZucker 342 Practically a Master Poster

Don't forget PySide (QT based)
http://srinikom.github.io/pyside-docs/contents.html

Note:
wxPython is a bitch to work with on Python3
not sure what those folks are thinking

ZZucker 342 Practically a Master Poster

Typical example:

''' tk_toplevel_window101.py
create a toplevel popup window that overlaps the root window
'''

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

def popup_window():
    window2 = tk.Toplevel(root)
    # give window2 a position to overlap the root window
    window2.geometry("200x200+{}+{}".format(150, 150))
    window2.title("window2")
    window2['bg'] = 'yellow'
    tk.Button(window2, text='Leave window2', command=window2.destroy).pack()

root = tk.Tk()   # root is a toplevel window
# set 200x200 window upper left corner to x=100, y=50
root.geometry("200x200+{}+{}".format(100, 50))
root.title("root")
root['bg'] = 'green'

tk.Button(root, text='Pop up window2', command=popup_window).pack()

root.mainloop()
ZZucker 342 Practically a Master Poster

Sometimes comes in handy:

''' ps_qt_version101.py
show the version number for PYSide and the QT version it used
'''

import PySide
import PySide.QtCore

# prints PySide version
print(PySide.__version__)

# gets a tuple with each version component
print(PySide.__version_info__)

print('-'*30)

# prints the Qt version used to compile PySide
print(PySide.QtCore.__version__)

# gets a tuple with each version components of Qt used to compile PySide
print(PySide.QtCore.__version_info__)

''' possible result ...
1.1.1
(1, 1, 1, 'final', 1)
------------------------------
4.7.4
(4, 7, 4)
'''
ZZucker 342 Practically a Master Poster

I am somewhat confused, are you talking about a list of (r, g, b) tuples?
If you don't need the high speed of numpy, go with those.

ZZucker 342 Practically a Master Poster

From last years vacation on Lake Michigan. 0bbe5a163bc1c00c67f1fbfbf1952853

ZZucker 342 Practically a Master Poster

For sheer ease of use the HP Chromebook 11 is handy.

ZZucker 342 Practically a Master Poster

A Fiber One lemon bar and peppermint tea.

ZZucker 342 Practically a Master Poster

"Getting an MBA is the death sentence for tinkering. Nothing drives out the pleasure of experiment like a business degree, and the better the school, the worse the impact."
--- Elliot S. Weissbluth

ZZucker 342 Practically a Master Poster

A good approximation of the cosine of a given angle can be obtained with the following series calculation:

''' cos_approximate102.py
based on series ...
cos(x) = 1 - x2/2! + x4/4! - x6/6! + ..
'''

import math

theta = 45
x = math.radians(theta)
cosx = 1
alt = 1
for n in range(2, 15, 2):
    # alternate between 1 and -1
    alt *= -1
    cosx += alt*math.pow(x, n)/math.factorial(n)
    #print(cosx)  # test

print("Approximate cos({}) = {}".format(theta, cosx))
print("Module math cos({}) = {}".format(theta, math.cos(x)))

''' result ...
Approximate cos(45) = 0.707106781187
Module math cos(45) = 0.707106781187
'''

Write a Python program to do the calculation for this series:
sin(x) = x - x3/3! + x5/5! - x7/7! + ..

ZZucker 342 Practically a Master Poster

Module math also has:
math.degrees(x) converts angle x from radians to degrees.
math.radians(x) converts angle x from degrees to radians.

You can get a good free online book here:
http://www.greenteapress.com/thinkpython/

ZZucker 342 Practically a Master Poster

The nice thing about glob.glob() is that handles mixed case extensions like .Py or .TxT or .Txt that sometimes appear.

ZZucker 342 Practically a Master Poster

Is wxPython still around?

ZZucker 342 Practically a Master Poster

Learn, listen, logic.

ZZucker 342 Practically a Master Poster

"A lie gets halfway around the world before the truth has a chance to get its pants on."
... Winston Churchill

ZZucker 342 Practically a Master Poster

Snow in the mountains, sunshine in the valley.

ZZucker 342 Practically a Master Poster

A shroomburger and ginger ale.

ZZucker 342 Practically a Master Poster

Hating might be better than whipping.

ZZucker 342 Practically a Master Poster

It seems that Java is being updated just about every time I turn my Pc on. Is it really that full of bugs?

ZZucker 342 Practically a Master Poster

supercalifragilisticexpialidocious

ZZucker 342 Practically a Master Poster

The tourist trap (the place is full of cars) of Virginia City Nevada. This homely looking place sprang up as a boomtown on top of the Comstock Lode, the first major silver deposit discovered in the United States, in 1859. It was once the major town in the wild west. Bonanza's Cartwright family were supposed to live in the area of Virginia City.

The picture that veedeoo shows of Zion Canyon is actually Bryce Canyon in Utah.

ZZucker 342 Practically a Master Poster

You can change *.jpg to *.py, but that won't show you the .txt files.