[Tutor] Born to be free

2018-11-23 Thread Avi Gross
Alan,

Yes, I meant that many things are effectively free these days. Some things are 
required to be distributed free by CopyLeft. But you can pay a nominal fee for 
say a CD of the software. You can pay for a bundle like you describe, perhaps 
including some consulting or warranties to keep you updated or who knows what?

I have been using a slew of programs lately in work for someone else who gave 
me access to software they paid for under some license. I mean statistical 
tools that are sold or licensed and have been around for ages. But I find I can 
cobble together my own programs and often find packages for free to do some 
parts. But as noted, I often have to process data that came from sources like 
SAS, MPLUS, STATA, SPSS and others. I often have to return the results of the 
calculations back in those formats. I have not felt the urge to buy the 
software but the day may come. My goal is to use a variety of tools that 
include R and Python unless the easiest path is ...

I am not in the market for buying or selling such things so I simply admit my 
lack of encyclopedic memory and experience.  I suggested that based on my 
knowledge, to date, I gather Python is mostly available for free and this might 
impact companies that wish to bend it to their needs rather than paying someone 
to give them an expensive tool. 

Many languages and other shared goods have ISO committees or Standards Bodies 
that document it or regulate changes. In the past, I often found companies like 
AT&T and HP attending all kinds of such bodies to influence the direction they 
take or be informed where they are headed. 

Some people have a photographic memory while some have a pornographic memory. 
Anyone with both is beyond dangerous 😉

-Original Message-
From: Tutor  On Behalf Of Alan 
Gauld via Tutor
Sent: Thursday, November 22, 2018 7:54 PM
To: tutor@python.org
Subject: Re: [Tutor] origins bootstrapped.

On 22/11/2018 06:05, Steven D'Aprano wrote:

> I don't know of any non-free (free as in beer, or free as in speech) 
> implementations of Python. Can you elaborate?

There are several commercial distributions (as opposed to
implementations) of Python, that may be what Avi has in mind.
Some of these are commercial IDEs that include python as part of an integrated 
bundle - I think Blackadder is one such - and others are just uber distros like 
Enthought Entropy(?) which is a "supported" distro for scientific work - rather 
like Anaconda.

Others are in the Movie industry where it is either tied to a particular tool 
or again to a support arrangement.

The implementations are the standard open source code but the distribution is 
paid for, with the value add either in the toolset, the packaging or the 
support.

But maybe Avi means something different...

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] A required question

2018-11-23 Thread Avi Gross
Just to be different, and perhaps return to the purpose of this group, I have a 
question.

 

Is there some functionality available in Python that you could put in the 
beginning of a program so it aborts with a message if the version of R being 
run is not acceptable?

 

Let me elaborate. There seem to be new features added as you move up. I mean 
2.2, 2.3, … 3.0 and so on.

 

But there also seem to be features deprecated then removed.

 

To make it crazier, some features are back-ported into later releases of 2.X 
while some features are activated only in you import the right things from 
__FUTURE__ .

 

Add to that the fact that various modules may exist or not exist on your 
machine in your search PATH and they may import yet others, and it gets crazy. 
Even weirder is that you can probably download a missing file as the program 
runs and then import it and probably many other scenarios where you own program 
writes a module and then imports it!

 

What I was thinking was the ability to do something like this:

 

import ReChoir as require

 

require.version(condition, before=True, after=False)

require.modules(module list, recursive=True)

require.os([“Eunuchs”, “Windblows”])

require.functionality(“print3”)

 

I hope you get the idea. Any one of the statements above might be made anywhere 
in your program but is best near the top of the main program perhaps after any 
imports from the dunder FUTURE.

 

I am not designing it. I am giving a very silly example and also suggesting a 
possible scenario like this:

 

if ! require( <> ):

print(“Sorry, your system is too primitive to use this snazzy 
software.”)

print(“In a moment, you will be re-directed to a dumber version 
written”)

print(“stone age tools. Please upgrade son.”

print(“running program paleo.py for you with same arguments.”

sleep(5)

exit( os.system(<<<“call to python to run paleo.py with same 
args using argv …”>>>) )

 

So in some cases, you quit with a message saying why you quit. In the example 
at the end, you may call alternate functionality, perhaps a shell-script rather 
than python, that does something for them. In an extreme case, the script would 
download a later version of Python as a sort of bootstrap. 😊

 

Yes, tons of holes in here and implementation details. For example, some 
features are only needed if the command line or data lead you down some path. 
No need to abort most of the time and not easy or even possible to see if you 
might need it.

 

So is there anything interesting out there already, designed to not so much 
make python portable, but to prevent things from running and then dying in 
middle of something important. 

 

Yes, I know there is an assert command you can use and there are system 
variables you can query to see what version of Python you are running on what 
OS and so on. No doubt there are tools you can use to see if everything 
imported exists (maybe not the right file) somewhere in the path. The latter 
alone is a huge issue as there have been changes in how you import including 
some really odd ones where they broke old functionality. 

 

There may come a day when 2.X is as extinct as polio (stubbornly hanging in 
there as some refuse to vaccinate) but I do not foresee the march of changes 
slowing in 3.x, let alone 4.x^2 and beyond.

 

Such a tool might make it easier for people to use new features with less fear.

 

One more thought. Such a function set might simply try new features inside a 
“try” and catch the error so they can gracefully annoy the user with a snide 
remark and even tell them what is missing. For example a line with a := in it 
should fail everywhere now but might work later. An f”string” is not that old. 
A line using open() in an iterator context would fail somewhere back in 2.x. In 
theory, you can make a list of testable new features and even give them names 
you can ask for such as the “print3” above.

 

Why do I ask? I had a great day today except it followed a horrible day 
yesterday. I did a bunch of work in R but the main point could just as easily 
happen in Python. I wanted various packages to do various things. Some had 
broken for me in the last year or so and been replaced with something that 
refused to work. In English, it was supposed to take a linear model generated 
from data and calculate some predicted info from it and make a nice graph with 
lines showing the impact of another variable at the mean and +/- a standard 
deviation. The problem is that I had the latest version of R installed but some 
of the many packages required were not yet available or their dependencies were 
either not available or of the wrong date. This happens with Python modules 
too. With lots of research, I loaded some things from alternate places and 
backed up to older versions and then forward and eventually had a brainstorm of 
figuring out what to fee

Re: [Tutor] A required question

2018-11-23 Thread Alan Gauld via Tutor
On 23/11/2018 05:34, Avi Gross wrote:
> Just to be different, and perhaps return to the purpose of this group,

Actually I think the higher level debate of Python's direction as
a teaching language is entirely appropriate for this group. It kind
of defines the group and and its current and future role.

Whereas...

> What I was thinking was the ability to do something like this:
> 
> import ReChoir as require
> 
> require.version(condition, before=True, after=False)
> require.modules(module list, recursive=True)
> require.os([“Eunuchs”, “Windblows”])
> require.functionality(“print3”)

I can see the logic but suspect discussion of new features is
probably the preserve of the main Python list. If you can get
traction there somebody might actually go ahead and write one!

On the tutor list such matters are usually adequately covered
by virtual environments etc.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] A required question

2018-11-23 Thread David Rock

> On Nov 23, 2018, at 09:35, Alan Gauld via Tutor  wrote:
> 
> On 23/11/2018 05:34, Avi Gross wrote:
>> What I was thinking was the ability to do something like this:
>> 
>> import ReChoir as require
>> 
>> require.version(condition, before=True, after=False)
>> require.modules(module list, recursive=True)
>> require.os([“Eunuchs”, “Windblows”])
>> require.functionality(“print3”)
> 
> I can see the logic but suspect discussion of new features is
> probably the preserve of the main Python list. If you can get
> traction there somebody might actually go ahead and write one!

discussion of a “require” library probably isn’t necessary.  It’s pretty 
straightforward to include the logic using existing methods.

For the version of python, test against sys.version_info
For the modules, put your import calls in a try block and handle exceptions
For the OS version, test against os.name or sys.platform
The last one, “functionality,” is a bit vague.  Probably another candidate for 
a try block.


— 
David Rock
da...@graniteweb.com




___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor