[CentralOH] 2015-04-10 道場 Scribbles 落書/惡文? Self-printing Programs; Squatting; Books; nose; pip v PEP; modbus pi; visualization; Frying Bird in Flight; Para(sol|guas); umbra; refactoring

jep200404 at columbus.rr.com jep200404 at columbus.rr.com
Sun Apr 12 00:37:43 CEST 2015


wp: prefix means Wikipedia
To get good answers, consider following the advice in the links below.
http://catb.org/~esr/faqs/smart-questions.html
http://web.archive.org/web/20090627155454/www.greenend.org.uk/rjk/2000/06/14/quoting.html

Playing with programs that print themselves out.
Which is easiest for you to understand?

==> quince1.py <==
import sys

with open(sys.argv[0]) as _file:
    for line in _file:
        print(line, file=sys.stdout, end='')

# The file=sys.stdout is unnecessary.

==> quince2.py <==
import sys

with open(sys.argv[0]) as _file:
    for line in _file:
        print(line, end='')

# Note the leading underscore in _file.

==> quince3.py <==
import sys

with open(sys.argv[0]) as _file:
    for line in _file:
        sys.stdout.write(line)

# <filelikeobject>.write() does not add a newline.
# print() adds a newline by default, hence end=''.

==> quince4.py <==
import sys

for line in open(sys.argv[0]):
    print(line, end='')

==> quince5.py <==
import sys

print(open(sys.argv[0]).read(), end='')

==> quince6.py <==
import sys

sys.stdout.write(open(sys.argv[0]).read())

Somebody else had reservation for Community Room but they did not show up,
so we got the room anyway. This is second such incident in recent months. 

Two books were borrowed:

    Beginning Python Visualization
    Crafting Visual Transformation Scripts
    http://www.apress.com/9781430218432/

    Learning Python, 5th Edition
    http://shop.oreilly.com/product/0636920028154.do

nose program
https://pypi.python.org/pypi/nose/

pip versus PEP

PEP: Python Enhancement Proposals 
https://www.python.org/dev/peps/

pip: The PyPA recommended tool for installing Python packages.
https://pypi.python.org/pypi/pip/

https://www.python.org/dev/peps/pep-0020/
https://www.python.org/dev/peps/pep-0008/

Modbus sensor
raspberry pi
http://pyvideo.org/search?models=videos.video&q=visualization

explored recursive functions
http://stackoverflow.com/questions/2917210/python-what-is-the-hard-recursion-limit-for-linux-mac-and-windows
https://duckduckgo.com/html/?q=python+recursion+limit
See colug.net/python/dojo/20150410

wp:Crescent Dunes Solar Energy Project
fries birds like ants under a magnifying glass
When microwave radar pioneers could track birds, they killed some.

parasol for sun
paraguas for water
umbrella
umbra (shadow)
penumbra

Was asked if it was OK to bring code for refactoring.
It most certainly is.


More information about the CentralOH mailing list