Re: JSON-encoding very long iterators

2014-09-29 Thread Ian Kelly
On Mon, Sep 29, 2014 at 7:19 PM, wrote: > I would like to add the ability to JSONEncode large iterators. Right now > there is no way to do this without modifying the code. > > The JSONEncoder.default() doc string suggests to do this: > For example, to support arbitrary iterators, you cou

JSON-encoding very long iterators

2014-09-29 Thread alfred
I would like to add the ability to JSONEncode large iterators. Right now there is no way to do this without modifying the code. The JSONEncoder.default() doc string suggests to do this: For example, to support arbitrary iterators, you could implement default like this::

Re: Weird SSL problem

2014-09-29 Thread Ned Deily
In article , Roland Hedberg wrote: > Hi! > > I¹m trying to access > https://stsadweb.one.microsoft.com/adfs/.well-known/openid-configuration > > Doing it the simplest way I get the following: > > >>> import urllib > >>> f = > >>> urllib.urlopen("https://stsadweb.one.microsoft.com/adfs/.well

Re: Teaching Python

2014-09-29 Thread Terry Reedy
On 9/29/2014 9:18 AM, Gabor Urban wrote: Hi, my 11 years old son and his classmate told me, that they would like to learn Python. They did some programming in Logo and turtle graphics, bat not too much. Doesn anybody has an idea how to start? Python has a turtle module, so they can continue w

Re: Teaching Python

2014-09-29 Thread John Ladasky
I am actually teaching Python as a side job. My students have ranged from eighth graders, up to a Silicon Valley hardware engineer who had no coding experience, but who needed to do some test engineering. My wife is an elementary school teacher. We occasionally talk about age-appropriate lear

Re: Teaching Python

2014-09-29 Thread Simon Ward
On 29 September 2014 14:18:31 BST, Gabor Urban wrote: >my 11 years old son and his classmate told me, that they would like to >learn Python. They did some programming in Logo and turtle graphics, >bat >not too much. > >Doesn anybody has an idea how to start? "How to Think Like a Computer Scient

Re: Teaching Python

2014-09-29 Thread Seymore4Head
On Mon, 29 Sep 2014 15:18:31 +0200, Gabor Urban wrote: >Hi, > >my 11 years old son and his classmate told me, that they would like to >learn Python. They did some programming in Logo and turtle graphics, bat >not too much. > >Doesn anybody has an idea how to start? I ordered this book from the l

Re: trouble building data structure

2014-09-29 Thread Ian Kelly
On Mon, Sep 29, 2014 at 7:52 AM, Steven D'Aprano wrote: > Whether you prefer to use setdefault, or a defaultdict, is a matter of > taste. There is potentially a significant difference in performance -- with setdefault, the subordinate data structure is created on every call to be passed into setd

Re: Obscuring Python source from end users

2014-09-29 Thread Sturla Molden
Chris Angelico wrote: >> I have a project that involves distributing Python code to users in an >> organisation. Users do not interact directly with the Python code; they >> only know this project as an Excel add-in. >> >> Now, internal audit takes exception in some cases if users are able to >>

Re: Obscuring Python source from end users

2014-09-29 Thread Sturla Molden
Steven D'Aprano wrote: > Another possibility is to distribute your modules inside a zip file. See > here: > > https://mail.python.org/pipermail/python-list/2014-July/675506.html > > Such zip files are not just runnable, but also importable. Depending on your > Excel requirements, you might need

Re: Storage Cost Calculation

2014-09-29 Thread Denis McMahon
On Sun, 28 Sep 2014 20:07:31 +, Duncan Booth wrote: > Later on the B+ had 64k of RAM and the B+128 had 128k of RAM and in each > case the additional RAM was paged in as necessary but I don't think the > RAM in the B was ever expandable. You could get various expansions to page multiple roms,

Re: Storage Cost Calculation

2014-09-29 Thread Skippy
Abohfu venant zinkeng gmail.com> writes: > > > > > Hard drives have been the secondary storage of choice on computers for many years. They have improved in speed, in capacity, and in cost for over 50 years. It's interesting to look at how the prices have dropped, or, conversely, how much stor

Re: trouble building data structure

2014-09-29 Thread Steven D'Aprano
David Alban wrote: > greetings, > > i'm writing a program to scan a data file. from each line of the data > file > i'd like to add something like below to a dictionary. my perl background > makes me want python to autovivify, but when i do: > > file_data = {} > > [... as i loop th

Re: Teaching Python

2014-09-29 Thread Chris Angelico
On Mon, Sep 29, 2014 at 11:38 PM, Rustom Mody wrote: >> https://docs.python.org/3/tutorial/ > > The official tutorial for an 11 year old?? I dont think so... I don't see why not, to be honest. Not a lot of difference between his 11yo son and my 12yo sister, and I just pointed her at the tutorial

Re: Teaching Python

2014-09-29 Thread Rustom Mody
On Monday, September 29, 2014 6:59:10 PM UTC+5:30, Chris Angelico wrote: > On Mon, Sep 29, 2014 at 11:18 PM, Gabor Urban wrote: > > my 11 years old son and his classmate told me, that they would like to learn > > Python. They did some programming in Logo and turtle graphics, bat not too > > much. >

Re: Teaching Python

2014-09-29 Thread Steven D'Aprano
Gabor Urban wrote: > Hi, > > my 11 years old son and his classmate told me, that they would like to > learn Python. They did some programming in Logo and turtle graphics, bat > not too much. > > Doesn anybody has an idea how to start? The Internet is a big place, I always start by searching :-)

Re: Teaching Python

2014-09-29 Thread Chris Angelico
On Mon, Sep 29, 2014 at 11:18 PM, Gabor Urban wrote: > my 11 years old son and his classmate told me, that they would like to learn > Python. They did some programming in Logo and turtle graphics, bat not too > much. > > Doesn anybody has an idea how to start? Right here: https://docs.python.org

Teaching Python

2014-09-29 Thread Gabor Urban
Hi, my 11 years old son and his classmate told me, that they would like to learn Python. They did some programming in Logo and turtle graphics, bat not too much. Doesn anybody has an idea how to start? -- Urbán Gábor Linux is like a wigwam: no Gates, no Windows and an Apache inside. -- https:

Re: Obscuring Python source from end users

2014-09-29 Thread Steven D'Aprano
norman.i...@gmail.com wrote: > Hello list > > Python 3.4 applies. > > I have a project that involves distributing Python code to users in an > organisation. Users do not interact directly with the Python code; they > only know this project as an Excel add-in. > > Now, internal audit takes excep

ANN: eGenix PyCon UK 2014 Talks & Videos

2014-09-29 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix PyCon UK 2014 Talks & Videos This announcement is also available on our web-site for online reading: http://www.egenix.com/company/news/PyCon-UK-2014-Presentations.html

Re: Obscuring Python source from end users

2014-09-29 Thread Chris Angelico
On Mon, Sep 29, 2014 at 6:55 PM, Chris Angelico wrote: > It ought to be possible to do an AST reconstitution for at least part > of this. I can hunt down some of my PEP 463 test code to help out with > that. It should be possible to figure out what names are local, and > then just use those. > > I

Weird SSL problem

2014-09-29 Thread Roland Hedberg
Hi! I’m trying to access https://stsadweb.one.microsoft.com/adfs/.well-known/openid-configuration Doing it the simplest way I get the following: >>> import urllib >>> f = >>> urllib.urlopen("https://stsadweb.one.microsoft.com/adfs/.well-known/openid-configuration";) Traceback (most recent call

Re: Obscuring Python source from end users

2014-09-29 Thread Chris Angelico
On Mon, Sep 29, 2014 at 6:41 PM, wrote: > Crunching the source is an interesting idea that could achieve that end, but > it seems fraught with problems like maintaining consistency between renaming > objects in a module and renaming where imports happen. > Here's a technique that you could use

Re: Obscuring Python source from end users

2014-09-29 Thread alister
On Mon, 29 Sep 2014 00:36:47 -0700, norman.ives wrote: > Hello list > > Python 3.4 applies. > > I have a project that involves distributing Python code to users in an > organisation. Users do not interact directly with the Python code; they > only know this project as an Excel add-in. > > Now,

Re: Obscuring Python source from end users

2014-09-29 Thread norman . ives
Thanks for the reply! I'm not concerned about hiding the source code in a fundamental way. The condition that needs to be satisfied is that independent validators (in the organisation) must not "have access" to the source code. Crunching the source is an interesting idea that could achieve that

Re: Obscuring Python source from end users

2014-09-29 Thread Chris Angelico
On Mon, Sep 29, 2014 at 5:36 PM, wrote: > I have a project that involves distributing Python code to users in an > organisation. Users do not interact directly with the Python code; they only > know this project as an Excel add-in. > > Now, internal audit takes exception in some cases if users

Obscuring Python source from end users

2014-09-29 Thread norman . ives
Hello list Python 3.4 applies. I have a project that involves distributing Python code to users in an organisation. Users do not interact directly with the Python code; they only know this project as an Excel add-in. Now, internal audit takes exception in some cases if users are able to see th

Re: Leap year

2014-09-29 Thread Rustom Mody
On Saturday, September 27, 2014 9:21:15 AM UTC+5:30, Seymore4Head wrote: > Still practicing. Since this is listed as a Pseudocode, I assume this > is a good way to explain something. That means I can also assume my > logic is fading with age. > http://en.wikipedia.org/wiki/Leap_year#Algorithm >