New words:
tup = ('ello World','uello World')
print('\n'.join(chr(n)+tup[chr(n)=='Q']for n in range(66, 91)))
New words:
tup = ('ello World','uello World')
print('\n'.join(chr(n)+tup[chr(n)=='Q']for n in range(66, 91)))
Your code tells me that you are using Python2.
Where is your start?
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."
I gave enki a try, but it failed the simple name = input("Enter your name: ")
test using it on Python34 and Windows7.
"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?
Just survived the "Pineapple Express" that gave large parts of California nine inches of rain.
I just had a taste of Starbucks Holiday Blend coffee, real good stuff.
Don't you feel important with all those emails?
My guess is that the folks at Sony wish they used ProtonMail.
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?"
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.
I am not sure why science has such a bad stigma amongst US teenagers. Maybe because our only heroes are military or sports/entertainers.
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
Oh wow, I didn't know about the magic dragon's demise. What a tragedy!
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.
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.
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
'''
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.
Strassburger Leberwurst on a potato bagel, and cool mango lemonade.
The integral from -infinity to infinity of e^(-x^2) is sqrt(pi).
"Heads, she wins! Tails, you lose!"
¿umop apisdn upside down?
You might have to update/refresh self.getControl
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.
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.
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
One way would be to use the function's documentation string to do this.
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))
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.
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'}
'''
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
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()
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)
'''
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.
From last years vacation on Lake Michigan.
For sheer ease of use the HP Chromebook 11 is handy.
A Fiber One lemon bar and peppermint tea.
"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
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! + ..
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/
The nice thing about glob.glob() is that handles mixed case extensions like .Py or .TxT or .Txt that sometimes appear.
Is wxPython still around?
Learn, listen, logic.
"A lie gets halfway around the world before the truth has a chance to get its pants on."
... Winston Churchill
Snow in the mountains, sunshine in the valley.
A shroomburger and ginger ale.
Hating might be better than whipping.
It seems that Java is being updated just about every time I turn my Pc on. Is it really that full of bugs?
supercalifragilisticexpialidocious
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.
You can change *.jpg to *.py
, but that won't show you the .txt
files.