Re: [Tutor] Installing python

2018-11-02 Thread Mats Wichmann
ays install for everyone.
> 
>> the "modern" answer for Windows is supposed to be the Python Launcher,
> 
> I keep forgetting that thing exists. I really must spend
> some time getting to grips with it...

I used it for a bit because I was trying to disentangle test suite
failures unique to windows for a project... and had four concurrent
versions of python while doing that. but then ended up having to install
a bunch of "extra" stuff so set up virtualenvs to precisely control the
environment I was getting, and not using py any more.

I think it's a case of you use what works and that may not require
python launcher, if what you already have works fine :) (esp. for those
of us who are not necessarily normally windows users)
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Installing python

2018-11-02 Thread Alan Gauld via Tutor
On 02/11/2018 23:44, Mats Wichmann wrote:

> that's actually exactly the right path for a Python 3.5+ if you chose a
>  "user install", which you usually should. 

Ah, I always install for all users. That's why I've not
seen that path presumably?

But why *should* you install for a single user? I only
ever do that for programs that I'm still writing and
don't want other users to accidentally start. But I
want everyone to be able to run my Python programs
so I always install for everyone.

> the "modern" answer for Windows is supposed to be the Python Launcher,

I keep forgetting that thing exists. I really must spend
some time getting to grips with it...


-- 
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] Installing python

2018-11-02 Thread Mark Lawrence

On 02/11/2018 22:49, Alan Gauld via Tutor wrote:

On 02/11/2018 21:13, Roger Lea Scherer wrote:


I have installed python 3.7 on my computer Windows10
(C:\Users\Roger\AppData\Local\Programs\Python\Python37),


Caveat: I'm no expert on modern Windoze.
But... That looks like the wrong path to me.

My Windows install is usually either in

C:\Python...
or
C:\Program files\Python...

Depending on distro...



The C:\Users... path has been the standard for some time for a single 
user install.  C:\Python was binned some years back for security reasons 
whilst C:\Program Files\Python... was added for security reasons.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: [Tutor] Installing python

2018-11-02 Thread Mats Wichmann
On 11/2/18 4:49 PM, Alan Gauld via Tutor wrote:
> On 02/11/2018 21:13, Roger Lea Scherer wrote:
> 
>> I have installed python 3.7 on my computer Windows10
>> (C:\Users\Roger\AppData\Local\Programs\Python\Python37), 
> 
> Caveat: I'm no expert on modern Windoze.
> But... That looks like the wrong path to me.
> 
> My Windows install is usually either in
> 
> C:\Python...
> or
> C:\Program files\Python...
> 
> Depending on distro...

that's actually exactly the right path for a Python 3.5+ if you chose a
 "user install", which you usually should. Nothing wrong there. However,
you should check if it is in the path - if you wanted it in the path.
More below.

> 
> How exactly did you install it? Did you use the Pyhon.org
> binary installer? Did you use the default settings?
> 
> I don't know if they have 3.7 available yet,
> but I usually recommend activestate.com for
> Windows users, its install seems less
> problematic in my (limited) experience.
> And of course comes loaded with lots of
> extra Windows specific goodies.
> 
>> the git repository that holds all my projects and type "python --version"
>> in WindowsPowershell, I get Python 3.6.5.
> 
> So you must have two Pythons installed?
> What is your PATH set to? That's what controls
> which Python you pick up (along with some
> registry settings)
> 
>> So I guess my question is am I supposed to install python 3.7 in the git
> 
> Definitely not!
> 
>> a related question I think, am I supposed to install python
>> 3.7 in every virtual environment I create, 
> 
> I don't think so but  never use virtual environments.
> Never found a need.
> 
>> I guess I'm so used to installing programs in Windows or Mac and having
>> them accessible globally

actually, windows makes that harder than Mac or Linux, where programs go
to a global shared location.  on windows apps go... well, all kinds of
places, but it's nearly always a _unique_ directory per app.  if you
look in Program Files and Program Files (x86) that's what you see - a
unique directory either per program, or per vendor (like Microsoft,
Adobe, etc.) - and then program-specific subdirectories somewhere
underneath.  All that mess is papered over by adding each one of those
directories to your path.  which many programs do by default, and some
ask you.  Python asks you - but not in a very obvious way, I think you
have to select the advanced options before you even see the question.

the "modern" answer for Windows is supposed to be the Python Launcher,
which should be in your path, and is invoked by typing "py". py lets you
speficy the python you want if you don't want the default.  Try this for
grins:

py -0 --list

it shows you what it thinks are the available Pythons on your system.

if you indeed get two, and the default is 3.6, then you can run Python
3.7 by typing:

py -3.7

pretty simple, hopefully.

hope this helps.

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


Re: [Tutor] Installing python

2018-11-02 Thread Steven D'Aprano
On Fri, Nov 02, 2018 at 02:13:46PM -0700, Roger Lea Scherer wrote:
> Hey,
> 
> I have installed python 3.7 on my computer Windows10
> (C:\Users\Roger\AppData\Local\Programs\Python\Python37), but when I go to
> the git repository that holds all my projects and type "python --version"
> in WindowsPowershell, I get Python 3.6.5.

What happens if you type "python37 --version" instead?

What happens if you call the Python launcher instead? Try this and see 
what it does:

py -V

https://docs.python.org/3/using/windows.html#launcher


> So I guess my question is am I supposed to install python 3.7 in the git
> repository?

Heavens no.


> I guess I'm so used to installing programs in Windows or Mac and having
> them accessible globally (I guess is the word) that I expected python 3.7
> to do the same thing, 

I expect it is accessible globally, but you need to know what to call 
it. I'm not a Windows expert, but I expect that it will be more or less 
equivalent to other OSes in the sense that when you call a program by 
name (say, "notepad", or "python") it searches a list of known program 
locations (probably recorded in the Registry) for a matching name, and 
runs the first one found.

I expect that you have entries for 

python36
python37

and probably others, plus an alias for "python" which points to 
python36. You may be able to change the alias, but I don't know how you 
do that on Windows.

Or just be explicit about the one you want.

Or use the "py" Windows launcher, which is supposed to manage all that 
for you. (I don't know how well it works.)


> although I understand about programs written earlier
> crashing because of upgrades, like from 2.7 to 3.4 for instance.

They shouldn't *crash* the interpreter. If they do, that's a bug in the 
interpreter. They might *raise an exception*.

The difference is that a crash (a segfault or core dump) is the 
interpreter melting down and exploding, while an exception is a nicely 
controlled shut down.


Hope this helps shed some light on what's going on.



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


Re: [Tutor] Installing python

2018-11-02 Thread Alan Gauld via Tutor
On 02/11/2018 21:13, Roger Lea Scherer wrote:

> I have installed python 3.7 on my computer Windows10
> (C:\Users\Roger\AppData\Local\Programs\Python\Python37), 

Caveat: I'm no expert on modern Windoze.
But... That looks like the wrong path to me.

My Windows install is usually either in

C:\Python...
or
C:\Program files\Python...

Depending on distro...

How exactly did you install it? Did you use the Pyhon.org
binary installer? Did you use the default settings?

I don't know if they have 3.7 available yet,
but I usually recommend activestate.com for
Windows users, its install seems less
problematic in my (limited) experience.
And of course comes loaded with lots of
extra Windows specific goodies.

> the git repository that holds all my projects and type "python --version"
> in WindowsPowershell, I get Python 3.6.5.

So you must have two Pythons installed?
What is your PATH set to? That's what controls
which Python you pick up (along with some
registry settings)

> So I guess my question is am I supposed to install python 3.7 in the git

Definitely not!

> a related question I think, am I supposed to install python
> 3.7 in every virtual environment I create, 

I don't think so but  never use virtual environments.
Never found a need.

> I guess I'm so used to installing programs in Windows or Mac and having
> them accessible globally

That's what happens with Python for me...
But you have two versions installed so it depends on what
Windows thinks is the default install.

What happens if you have two versions of MS Office
installed and you type winword?

> to do the same thing, although I understand about programs written earlier
> crashing because of upgrades, like from 2.7 to 3.4 for instance. 

That's got nothing to do with install issues,
that's incompatibity in the code between v2 and v3.

I think the key is how exactly you installed both versions.

-- 
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] Installing python

2018-11-02 Thread Roger Lea Scherer
Hey,

I have installed python 3.7 on my computer Windows10
(C:\Users\Roger\AppData\Local\Programs\Python\Python37), but when I go to
the git repository that holds all my projects and type "python --version"
in WindowsPowershell, I get Python 3.6.5.

So I guess my question is am I supposed to install python 3.7 in the git
repository? and a related question I think, am I supposed to install python
3.7 in every virtual environment I create, or is there a way to link python
to each virtual environment or each repo or each project?

I guess I'm so used to installing programs in Windows or Mac and having
them accessible globally (I guess is the word) that I expected python 3.7
to do the same thing, although I understand about programs written earlier
crashing because of upgrades, like from 2.7 to 3.4 for instance. I'm so
confused I'm not sure I even know what questions to ask, but the above
questions seem to be a missing link in my knowledge at this point.

Thank you as always.

-- 
Roger Lea Scherer
623.255.7719

  *Strengths:*
   Input, Strategic,
Responsibility,

Learner, Ideation



Virus-free.
www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] TESTING

2018-11-02 Thread Alan Gauld via Tutor
On 02/11/2018 03:45, Avi Gross wrote:
> I am not totally up on the exact purposes of this group but have noted how
> many of the questions asked have been frustrating.

Unfortunately that goes with the territory.
We are a list catering to beginners to Python and, frequently,
to programming. As a result the participants often have little
or no experience of using technical mailing lists or fora.

> I wonder if it would make any sense to provide a template people might fill
> out to suit their needs.

The problem is how. Where would the template reside? We do
provide some hints on the welcome mails that go out but its
clear that most newcomers don't read it, so a template
would likely suffer the same fate.

But the biggest problem for a mailing list, unlike a web site,
is that there is nowhere to post information in a persistent
manner. You could go to the archive and search, but that takes
effort which newbies are unlikely to expend.

Also, we want to encourage people to use the list and a long
list of "rules" and formats is likely to drive them elsewhere.

> An example might be people who want you to pretty much do their homework for
> them from beginning to end.

This has been an issue as long as I've been on the internet
(ie since before 1986)and there is IMHO no cure other than
to consistently offer help but not solutions. Those who want
to learn will come back. Those who just want a quick fix
will just ask on Quora...

> But to do it ALL for someone generally is not the role of a tutor in the
> real world.

Absolutely.

> On the other hand, when someone discusses how to optimize their code, and
> shows the ways they already tried, it may be valid to present them with a
> complete program that illustrates it assuming this is not a homework problem
> but a more advanced person that may be interested.

And that's how we try to deal with it. If its a genuine
problem we will give more complete solutions, if its
(suspected) homework we give hints and tips.

> But, to make this message more meaningful, I have a question. In my reading
> I see Python has been bifurcated into often incompatible releases we call 2X
> and 3X. 

Yes, although 2.X is effectively deprecated. But industry
usage requires that it still gets some support.

> So, does anyone see any further breaks in Python such as when 4.0 comes
> along or will we have some backward compatibility for a while? 

Others can answer this better than I but so far each
generation of Python has been close to a decade apart
(v1 ~ 1991, v2 ~ c2000, v3 ~ c2010) So v4 would logically
appear around 2020, but I've seen no specific discussion
of that whereas both v2 and v3 had long debates about what
would be in/out and how much backward compatibility would
be included.

> one of the earlier guiding principles of Python was to have mainly one
> obvious way to do something and in my reading, I often see MANY ways

Yes, I've never bought the 1 obvious way line. Any decent
programming language offers multiple paths. Language idioms
may evolve to suggest a preferred option but in practice
you need alternatives for expressiveness.

> it. Much of this is caused by adding new features while retaining the old.

And is exacerbated by the Open Source model. Anyone can come up with a
"good idea" to "fix" an issue and it gets adopted. Just look at the long
history of how to start an external process from Python. system(),
popen() - and its several variants - exec(), command(), subprocess,,,

> especially when you use a package written by someone and then abandoned. 

That's always a problem with 3rd party libraries. If its in the core
language and standard library it should be maintained, or at least
go through a controlled and published obsolescence process.

> I wonder if others have written tools (such as in frozen programs) that
> gather up an exact snapshot of the environment needed when you submit a
> paper so it can be replicated!

That's really a configuration management issue and certainly such
tools exist, but they require you to store all the historical
versions within the CM system. The best I ever used was ClearCase
which had a concept of views, controlled by a text file. By changing
the view then restarting the tool it would magically recreate the
full disk image of the project as it had been frozen, including
code, compilers, debuggers etc. The only problem was when the OS
itself was incompatible and that required a virtual machine.
As a maintenance programmer it was absolutely brilliant. You could
take a bug report and within minutes have the relevant version
of the system loaded and ready to work, then next bug you had a
completely different version ready in the blink of an eye (well
maybe 2 or 3 minutes! :) But ClearCase cost megabucks.

-- 
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



Re: [Tutor] TESTING

2018-11-02 Thread Avi Gross
I am not totally up on the exact purposes of this group but have noted how
many of the questions asked have been frustrating.

I wonder if it would make any sense to provide a template people might fill
out to suit their needs.

An example might be people who want you to pretty much do their homework for
them from beginning to end. The purpose of a tutor is to guide someone in
learning how to do something for themselves. If they ask for an idea on an
algorithm in English or pseudocode on how to solve the problem, hey might be
given hints but not actual python code. If they wrote a snippet of code on
their own and wonder how to test it, again, there can be advice. If they ask
for the names of packages that might be useful, ditto. If they encounter an
error and can isolate it to a PART of the code, others might be willing to
point out that $ is not valid in Python user names (other than in regular
expressions or strings) and they should consider writing in a language like
PERL or a shell command language that uses it, albeit for another purpose.

But to do it ALL for someone generally is not the role of a tutor in the
real world.

On the other hand, when someone discusses how to optimize their code, and
shows the ways they already tried, it may be valid to present them with a
complete program that illustrates it assuming this is not a homework problem
but a more advanced person that may be interested.

But, to make this message more meaningful, I have a question. In my reading
I see Python has been bifurcated into often incompatible releases we call 2X
and 3X. Many times if you want something to be portable, you have to forgo
using some of the niftier new features. But for a language to evolve, you
sometimes need to bite the bullet. I was one of the earliest uses of C++
when I was at Bell Labs and the decision was then made to not just call it C
(or D or add-one-to-C or even ++C) but make a clean break with C and give it
a new name. The aforementioned PERL also split into incompatible languages. 

So, does anyone see any further breaks in Python such as when 4.0 comes
along or will we have some backward compatibility for a while? As I see it,
one of the earlier guiding principles of Python was to have mainly one
obvious way to do something and in my reading, I often see MANY ways to do
it. Much of this is caused by adding new features while retaining the old.
Yes, I also see places where a new feature is accompanied by deprecating an
older one and eventually removing it. But that too causes incompatibilities
especially when you use a package written by someone and then abandoned. I
recently ran into a problem with an R script I wrote a year or so ago that I
needed to modify in a minor way (re-scale the limits of the Y axis on a
graph) which I might have done in a few minutes. But the package I used to
do part of the work had been modified and the function just printed out that
I should use a replacement function which did not work. Reloading old
versions of the package still did not work because it had many dependencies
and getting them all correct was more work than rewriting my code after
reading what their code used to run.

I wonder if others have written tools (such as in frozen programs) that
gather up an exact snapshot of the environment needed when you submit a
paper so it can be replicated!

Avi

-Original Message-
From: Tutor  On Behalf Of
Mats Wichmann
Sent: Thursday, November 1, 2018 1:54 PM
To: tutor@python.org
Subject: Re: [Tutor] TESTING

On 11/1/18 11:24 AM, Mario Radomirovic wrote:
> All good
> 
> On Thu, 1 Nov 2018 6:17 pm Alan Gauld via Tutor  wrote:
> 
>> On 01/11/2018 14:01, richard mwenya via Tutor wrote:
>>> Hello.
>>> Everyone is quiet or is it my email thats not working?
>>
>> Just quiet, I've seen nothing in the moderators queue for 5 days. But 
>> that happens sometimes.
>>
>> I guess it just means nobody is having any Python issues right now.

or the ones who do gave up on us because people say they won't solve
homework problems :)


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