(normally) - in two flavors. Used only to prioritize high-traffic pages for dev work, iff JS and tracker enabled. The former/defunct training site's id: ga('create', 'UA-52578333-1', 'auto'). The book site's id, now used for all: ga('create', 'UA-52579036-1', 'auto'). JS is also used if enabled for thumbspage galleries, Top buttons, TOCs, etc. Jun-2019: tell Google Analytics to anonymize IP address on receipt for privacy. More: https://developers.google.com/analytics/devguides/collection/analyticsjs/. Oct-2022: install a GA4 tag (i.e., script) alongside the prior UA tag. UA tags will stop collecting data in 2023. It's okay to use both until the cutover (and Google advises doing so), but the UA tag will be pointless after that and should be removed. This handles genhtml-insert clients; others get tags by running insert-analytics.py in package-publishing scripts. Also per Google: "In Google Analytics 4, IP anonymization is not necessary since IP addresses are not logged or stored". Let's hope so... -->

PyLotto

To enter a drawing for a free Python book, fill out your name here and press the Submit button:


Description

Winners will be selected from among form submissions at random, by a Python script which can be viewed online at this site:

http://learning-python.com/pp4e-updates.html#lotto

As described there, the Python script's source code is also online (use your browser's "view source" to see this page's HTML code too):

http://learning-python.com/pylotto.py

In order to work around the security constraints at some sites, the pylotto script can run the lottery in 3 different main modes, selected by command-line options or query parameters: to select from emails, to select from names in a file created by this page, or to select from names typed into a local file manually. Its results can be displayed in console or CGI web reply page formats, and a variety of administrative and test modes are also available.

Note that submitting this form is equivalent to submitting a URL of the following form, typed into a browser window or sent with Python's urllib or similar:

http://learning-python.com/cgi/pylotto.py?-form=yourname
To run the lottery, a URL of the following form is submitted by the instructor (only — if you run this URL yourself, its results will be ignored!):
http://learning-python.com/cgi/pylotto.py?-show=cgi&-find=file



[Home page] Books Code Blog Python Author Train Find ©M.Lutz