Saturday

Python Web Programming with CherryPy

Python v2.7 64-bit Web Programming with CherryPy v3.2.3 64-bit

Download and install Python v2.7.8 64-bit (Python Interpreter) from
https://www.python.org/downloads/windows/

Download and install PyScripter v2.5.3 64-bit (Python IDE) from
https://code.google.com/p/pyscripter/downloads/list

Download and install pip-1.5.6.win-amd64-py2.7.exe from
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pip

Download and install setuptools-5.8.win-amd64-py2.7.exe from
http://www.lfd.uci.edu/~gohlke/pythonlibs/#setuptools

Download and install CherryPy-3.2.3.win-amd64.exe from
https://bitbucket.org/cherrypy/cherrypy/downloads/CherryPy-3.2.3.win-amd64.exe

Download and install pywin32‑219.win‑amd64‑py2.7.exe from
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pywin32

Download and install simplejson-3.6.4.win-amd64-py2.7.exe from
http://www.lfd.uci.edu/~gohlke/pythonlibs/#simplejson

Add the below two paths to the Windows OS environment variables path:
C:\Python27\Scripts
C:\Python27

Open PyScripter Python IDE

Type the following in the PyScripter Python Interpreter console window to check if the correct cherrypy version has been installed:
>>> import cherrypy
>>> cherrypy.__version__
'3.2.3'
>>>

Type the following in the PyScripter File Editor window:
{
import cherrypy

class HelloWorld(object):
    def index(self):
        return "Hello, World!"
    index.exposed = True

cherrypy.quickstart(HelloWorld())
}
Click on the {Toolbar > Play button}

Open the browser and point at http://127.0.0.1:8080 to see the web page output.

Click on the {PyScripter IDE > Toolbar > Stop button}

Open the .py file at
C:\Python27\Lib\site-packages\cherrypy\tutorial\tut02_expose_methods.py
Click on the {Toolbar > Play button}

Sunday

Online Python Script Interpreter(s)

Read-Evaluate-Print Loop IT
url: http://repl.it/languages/Python
notes: file editor by clicking on the play icon, console interpreter by hitting the enter key
try:
Python 2.7.2 (default, Jul 20 2011, 02:32:18)
[GCC 4.2.1 (LLVM, Emscripten 1.5, Empythoned)] on linux2
   [n for n in range(0,10,1) if n%2==1] #odd numbers
=> [1, 3, 5, 7, 9]

Codecademy Labs
url: http://labs.codecademy.com/#
notes: file editor and console interpreter
try:
You're running Python version 2.7.2. To get started, type in the console below or the text editor to the left. Want to learn more about Python? Take Codecademy lessons!
>  print time.localtime()
time.struct_time(tm_year=2010, tm_mon=11, tm_mday=12, tm_hour=1, tm_min=22, tm_sec=33, tm_wday=4, tm_yday=333, tm_isdst=0)
# dst is the daylight savings time 
> import os
> os.getcwd()
=> '/sandbox'

Python Tutor, Line-by-line Code Visualization
url: http://pythontutor.com/visualize.html#mode=edit
notes: only file editor, you can change the drop down box value to "show only outputs" if there is any output, has Python versions 2 and 3
LEARN programming by visualizing code execution
Helps students overcome a fundamental barrier to learning programming: understanding what happens as the computer executes each line of a program's source code. Using this tool, a teacher or student can write a Python program in the Web browser and visualize what the computer is doing step-by-step as it executes the program.
try:
Write: Python 2.7 code here or load an example:
    name = raw_input('What is your name?\n')
    print 'Hi, %s.' % name
Program Output:
    What is your name?
    Name1
    Hi, Name1.

codepad is an online compiler/interpreter and a simple collaboration tool
url: http://codepad.org/
notes: file editor only, select radio button Python
try:
Paste your code below, and codepad will run it and give you a short URL you can use to share it in chat or email.
text area:
print """
What is duck typing?
  It is a term used in dynamic languages
that do not have strong typing.
  The idea is that you don't need a type
in order to invoke an existing method on an object -
if a method is defined on it, you can invoke it.
  The name comes from the phrase
"If it looks like a duck and
quacks like a duck,
it's a duck".
"""
Click on the Submit button
Output:
01
02  What is duck typing?
03    It is a term used in dynamic languages
04  that do not have strong typing.
05    The idea is that you don't need a type
06  in order to invoke an existing method on an object -
07  if a method is defined on it, you can invoke it.
08  The name comes from the phrase
09  "If it looks like a duck and
10  quacks like a duck,
11  it's a duck".
12

Wandbox, [Python] python 2.7.3
url: http://melpon.org/wandbox/
notes: file editor only, choose compiler: [Python] python 2.7.3
try:
input code:
import calendar
print calendar.month(2013, 2)
print "Display multiplication table of 13"
for i in range(1,11):
   print 13,'x',i,'=',13*i
click the button "Run (or Ctrl+Enter)"
#1
Start
   February 2013
Mo Tu We Th Fr Sa Su
             1  2  3
 4  5  6  7  8  9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28


Display multiplication table of 13
13 x 1 = 13
13 x 2 = 26
13 x 3 = 39
13 x 4 = 52
13 x 5 = 65
13 x 6 = 78
13 x 7 = 91
13 x 8 = 104
13 x 9 = 117
13 x 10 = 130

0

Finish
input stdin: empty text area box
Tick two checkboxes: No Wrap, Expand

Ideone is an online compiler, IDE, and debugging tool which allows you to compile source code and execute it online in more than 60 programming languages.
url: http://ideone.com/
notes: only file editor, click run button to get the script output
Choose a programming language, enter the source code with optional input data... and you are ready to go!
try:
</> enter your source code or insert template or sample or your template:
# your code goes here
def factorial(n):
  if n == 0:
    return 1
  else:
    return n * factorial(n - 1)
print factorial(5)
Choose Python programming language from the drop-up list box
Click the "spectacles" icon for secret
Click on the link "few options" if there is any
Success
stdin:
Standard input is empty
stdout:
120

Execute Python Script Online (Python 2.7.4)
url: http://www.compileonline.com/execute_python_online.php
try:
notes: file editor only
try:
#!/usr/local/bin/python2.7
print 'a' "b" """c"""
Executing the program....
$python2.7 main.py
abc


References:
- http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html

Thursday

Thunderbird: How to search for email messages by certain category in your inbox?

Menu > Edit > Find > Search Messages (Ctrl + Shift + F)
Using this way, you may search for email messages by subject, from, date, or other category.

If a hater attacked your age and not the goodness of you

Whether young or old, I've always been known what endures. I've known the very idea of people that were all created equal and deserv...