Re: Simple graphic library for beginners

2018-01-12 Thread Michael Torrie
On 01/11/2018 11:48 PM, Jan Erik Moström wrote:
> On 10 Jan 2018, at 13:40, Jan Erik Moström wrote:
> 
>> I'm looking for a really easy to use graphic library. The target users 
>> are teachers who have never programmed before and is taking a first 
>> (and possible last) programming course.
> 
> Thanks for all the suggestions, I'm going to take a look at them and see 
> what fits my requirements best.

I'm glad you are willing to overlook all the noise in this thread!  Good
luck and let us know what path you end up taking.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-12 Thread Paul Moore
On 12 January 2018 at 17:25, Mikhail V  wrote:
> And the target Python where the package will be installed should be defined by
> a switch, e.g. 'pip -2', 'pip -3' (in analogy with 'py -2', 'py -3').
> The question is though, how pip will know what version(s) of python I have, 
> and
> if I installed them later? Hmm, not an easy problem. So in this case pip shoud
> track the multiple versions each time I install another version of python.

If that's how you want it to behave, just use "py -2 -m pip" or "py -3
-m pip" or "py -3.6 -m pip" as required. Works now, no hassle. You
still have to install pip (the package, not the executable) in each
Python home, but that's just how Python packages work (and pip is
already installed by default when you install Python on Windows
anyway).

Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-12 Thread Mikhail V
On Fri, Jan 12, 2018 at 10:38 AM, Paul Moore  wrote:
> On 12 January 2018 at 06:47, Steven D'Aprano
>  wrote:

>> If pip is joined at the hip to a specific version of Python, I think that
>> we ought to be able to specify the version number like we can with Python.
>>
>> Something like:
>>
>> pip ...  # use whichever version of pip comes first on the PATH
>> pip3.6 ...  # use the pip installed with Python 3.6
>> pip2.7 ...  # use the pip installed with Python 2.7
>
> Well, that's sort of how it's intended to work, but in practice it
> doesn't seem to be as straightforward as it ought to be. I can't
> really say why, as it's a Unix-only thing and I don't really
> understand the reasons, but it's why I'm a fan of the "python -m pip"
> approach. There's discussion on the pip tracker if you're interested
> enough to go searching - I know it's something that's been debated,
> but I don't recall the context.

In general I think more than one app and executable with same name
on a system already asks for problems.
On Windows I had issues with pip and pygame and I have two Pythons -
2.7.14 and 3.6.2.
The problem was that I could not make it install to 2.7, and tried many options,
looking in SO there were so many different solutions, but finally I found
something that reinstalled newer pip, but I don't remember frankly.

My opinion (from Windows user's POV) - I'd prefer if there should be
only one PIP in system,
so running pip will unambigiosly mean that I run (or upgrade) THE pip.
(and not something which I don't
even know where it is located). Ideally also it should be installed in
separate Directory.
So I'd have folders:

python 27
python 36
pip

And the target Python where the package will be installed should be defined by
a switch, e.g. 'pip -2', 'pip -3' (in analogy with 'py -2', 'py -3').
The question is though, how pip will know what version(s) of python I have, and
if I installed them later? Hmm, not an easy problem. So in this case pip shoud
track the multiple versions each time I install another version of python.


Mikhail
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-12 Thread Lele Gaifax
bartc  writes:

> If you a beginner, outsider, or infrequent user of Python with no idea of
> what the latest version is, except that you already have 3.6 but it might
> have a problem, which would you choose?

Unless you are also unable to read *and* understand, by any chance you'd
follow the very first link related to 3.7, and seeing "This is an early
developer preview of Python 3.7" you could *decide* if that's appropriate for
your goal.

But it seems you belong to yet a different category of people indeed, who
blindly follows the "I'm feeling lucky" Google advices.

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-12 Thread bartc

On 12/01/2018 01:56, Chris Angelico wrote:

On Fri, Jan 12, 2018 at 12:21 PM, bartc  wrote:

On 11/01/2018 23:23, Chris Angelico wrote:


On Fri, Jan 12, 2018 at 10:11 AM, bartc  wrote:




I'm almost ready to plonk you, but I think there is still SOME value
in your posts. But please, stop denigrating what you don't understand.



And please try to see things from the pointer of view of a beginner or
outsider, where anything to do with Python seems to have a bewildering and
conflicting array of solutions.


You mean the sort of person who goes to the front page


The front page of what?

 and sees just

two options, 2.7 and 3.6, and won't see anything about 3.7 until it's
released?


Google for 'download python windows'. The first hit is this site:

 https://www.python.org/downloads/windows/

But before you click on it, the google search summary includes two links 
in big type, to 2.7.14 and 3.7.0a2 (which are to information not 
downloads). That is a strong suggestion that those are the latest versions.


When you do go to that page, you are looking for a link that has 
'download' next to it. The first 6 such links on the page are all for 3.7.


If you a beginner, outsider, or infrequent user of Python with no idea 
of what the latest version is, except that you already have 3.6 but it 
might have a problem, which would you choose?



Again, a number of people have put in a lot of hours to make
that easy.


It appears that because of that I'm not allowed to make any 
observations, not ones that could be construed as criticism.


But as another example, search for 'download pelles c', the first hit 
should be this page:


  http://www.pellesc.de/index.php?lang=en=download

That I think is a better presentation than Python's. It's also clearer 
which is 32-bit and which is 64. (Will a beginner programmer who's not 
going to be coding low level really appreciate the difference between 
x86 and x86-64?)


But here's another example that goes the other way; the first hit for 
'download lua windows' is this:


  https://www.lua.org/download.html

A rather puzzling page with some gobbledygook on it that appears to do 
with Linux. And the download link gives a list of tar.gz files; not very 
useful.


The second hit isn't much more use; the third one is more promising.

I do get the impression that applications that originate on Windows are 
generally more accessible.


--
bartc
--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-12 Thread breamoreboy
On Friday, January 12, 2018 at 6:52:32 AM UTC, Steven D'Aprano wrote:
> On Fri, 12 Jan 2018 12:45:04 +1300, Gregory Ewing wrote:
> 
> > Seems to me it would help if pip were to announce which version of
> > Python it's installing things into. And instead of just saying "not
> > compatible with this version of Python", say "not compatible with Python
> > X.Y.Z". That would make these kinds of problems much easier to diagnose.
> 
> This.
> 
> If pip is joined at the hip to a specific version of Python, I think that 
> we ought to be able to specify the version number like we can with Python.
> 
> Something like:
> 
> pip ...  # use whichever version of pip comes first on the PATH
> pip3.6 ...  # use the pip installed with Python 3.6
> pip2.7 ...  # use the pip installed with Python 2.7

The time machine has struck again.  The scripts directory on Windows always 
gives you three executables.  pip.exe is always one of them, and then (say) 
pip3.exe and pip3.6.exe.

> etc.
> 
> And don't say "use a venv" :-)
> -- 
> Steven D'Aprano

--
Kindest regards.

Mark Lawrence.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-12 Thread Chris Angelico
On Fri, Jan 12, 2018 at 9:00 PM, Paul Moore  wrote:
> On 12 January 2018 at 09:12, Tim Golden  wrote:
>> I think the shame here is that there is a learning opportunity on both
>> sides. As Paul says: by and large, the huge amount of work which the Python
>> Packaging team, especially the pip developers, have put in has paid off.
>> It's now usually possible to say: "pip install XXX" and have it work out of
>> the box for any recentish version of Python on any recentish version of a
>> mainstream OS. Once people understand the basics of using that "interface",
>> many things become simple.
>>
>> Unfortunately, where that *doesn't* work, it probably won't be because of
>> low-hanging fruit: it'll be because of some strange interaction of different
>> versions, odd leftover PATH setups, obscure Windows C Runtime redistribution
>> issues, poor encoding interactions between Python and the Windows console,
>> and so on.
>
> Agreed. The other factor, and in my experience one of the most
> frustrating to deal with, is when people *don't* start with "pip
> install XXX", but instead find some complex process on the web, try
> that, have it fail, and then we have to help them untangle whatever
> mess that might have left for them.

This is particularly common on Windows, where the normal way to get
software is "go look on the web, download something, hope it's the
right thing, and give it free reign to install itself on your
computer". On Linux systems, people tend to be a bit more familiar
with the concept of package managers, so they aren't surprised to
learn that Python has one.

(Of course, there is still the big question of "which package manager
ought I to be using", very much an XKCD 927 situation, but at least
that's easier to ask about. "How did you install Python?" "With
apt-get." "Okay, then use apt-get to install the package." "It's not
in apt's repositories." "No problem, pip it is.")

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-12 Thread Paul Moore
On 12 January 2018 at 09:12, Tim Golden  wrote:
> I think the shame here is that there is a learning opportunity on both
> sides. As Paul says: by and large, the huge amount of work which the Python
> Packaging team, especially the pip developers, have put in has paid off.
> It's now usually possible to say: "pip install XXX" and have it work out of
> the box for any recentish version of Python on any recentish version of a
> mainstream OS. Once people understand the basics of using that "interface",
> many things become simple.
>
> Unfortunately, where that *doesn't* work, it probably won't be because of
> low-hanging fruit: it'll be because of some strange interaction of different
> versions, odd leftover PATH setups, obscure Windows C Runtime redistribution
> issues, poor encoding interactions between Python and the Windows console,
> and so on.

Agreed. The other factor, and in my experience one of the most
frustrating to deal with, is when people *don't* start with "pip
install XXX", but instead find some complex process on the web, try
that, have it fail, and then we have to help them untangle whatever
mess that might have left for them. That's really annoying because we
can't really do anything about out of date information - and expecting
people to realise that things are moving fast enough that 6 month old
instructions are out of date isn't realistic either. (In fact, until
this thread I wasn't aware that pygame had published wheels, so I'd
have probably tried something unnecessarily complex myself - just
proves that even being intimately familiar with the packaging
ecosystem isn't enough!!!)

> All of these admit of solutions (if only by way of more informative error
> messages and useful FAQs) but they take time and patience to reproduce and
> work through. Many people -- and especially beginners -- don't really have
> the time or the inclination to follow through. They're not really interested
> in the mechanics of pip or the interaction of Python with the Windows
> installation subsystem. They just want to use numpy or pygame, or whatever.
>
> Where there *are* people who are willing to take the time to work things
> through, we [the Python community and especially the packaging/pip crew] can
> welcome them and try to identify weak spots in our own story. But of course
> we react poorly if someone wants merely to dismiss stuff. (Typical tweet:
> "Sigh; Python packaging is still broken!").
>
> I've actually been installing pygame quite a few times recently as part of a
> Coding Dojo I help to run once a term at a school in South London. And, even
> with the wonderful packaging work which the pygame guys have done to get
> wheels on PyPI, it's still sometimes a little painful. Of course, in that
> context, I'm just hustling to get people up-and-running and I'll do whatever
> it takes without stopping to take notes. So I sympathise when people say
> it's not easy for them. But not when they're dismissive about it.

Understood. I've recently been working with a complete beginner, and
it's quite surprising (and a real eye-opener) where the pain points
lie. Running python and pip (PATH issues) was a huge problem, but "pip
install numpy" was trivial. That's totally not what I'd expected...
Often the big issue for people like myself working on packaging is
being too close to the problem, and as a result focusing on the wrong
things. *Any* feedback from beginners is good for improving that
situation.

If you have any details on particular pain points your users have
experienced, feel free to pass them on to me and I'll see if I can
work them into something actionable. I understand what you mean
though, getting details of what's wrong isn't the priority when you
have a class to get running.

Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-12 Thread Paul Moore
On 12 January 2018 at 06:47, Steven D'Aprano
 wrote:
> On Fri, 12 Jan 2018 12:45:04 +1300, Gregory Ewing wrote:
>
>> Seems to me it would help if pip were to announce which version of
>> Python it's installing things into. And instead of just saying "not
>> compatible with this version of Python", say "not compatible with Python
>> X.Y.Z". That would make these kinds of problems much easier to diagnose.
>
> This.

That does indeed sound like a reasonable suggestion. I don't know
immediately where in the code we'd put something like that (a banner
that says "Installing packages into Python at " wouldn't
be too hard, it could probably be added near the top of
pip._internal.commands.InstallCommand.run(), but the compatibility
stuff is a lot trickier because of how pip's finder works) but I'm
sure PRs would be acceptable.

> If pip is joined at the hip to a specific version of Python, I think that
> we ought to be able to specify the version number like we can with Python.
>
> Something like:
>
> pip ...  # use whichever version of pip comes first on the PATH
> pip3.6 ...  # use the pip installed with Python 3.6
> pip2.7 ...  # use the pip installed with Python 2.7

Well, that's sort of how it's intended to work, but in practice it
doesn't seem to be as straightforward as it ought to be. I can't
really say why, as it's a Unix-only thing and I don't really
understand the reasons, but it's why I'm a fan of the "python -m pip"
approach. There's discussion on the pip tracker if you're interested
enough to go searching - I know it's something that's been debated,
but I don't recall the context.

Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-12 Thread Paul Moore
On 12 January 2018 at 06:45, Steven D'Aprano
 wrote:
>> The recommendation was already given to use "python3 -m pip". That gets
>> around those problems.
>
> If you google for installation instructions, they're nearly always given
> in terms of "use pip", not "use python3.4 -m pip".
>
> My point isn't that there is *no* solution to this problem, but that its
> not necessarily an *obvious* solution.

We've discussed this a number of times on the pip mailing lists and
changing recommendations like this is a slow and difficult process.
We're only just managing to get people to change websites from
recommending easy_install...

The question of "pip" vs "python -m pip" is a hard one. On Windows,
"py -m pip" is better for a lot of reasons, but the Unix users
involved in the debates were pretty reluctant to standardise on
"python -m pip" rather than the familiar "pip" (or "pip3"? I'm not
sure I completely follow what is natural for Unix users). Personally,
I still think a lot of confusion would be addressed if we settled on
"python -m pip" (with the established understanding that "python"
stands for whichever of "python", "python2", "python3", "py",
"/full/path/to/python", ... you're using to access Python) - but I
don't know how we make that the "obvious" approach.

For all of Bart's rhetoric, it *is* hard to find a good way to present
a consistent message when people go to Google/Stack Overflow first,
and only check the official docs as a last resort.

>>> How do I deal with permissions errors? [semi-rhetorical question -- I
>>> know *an* answer, but I don't know if it is the *right* answer]
>>
>> That's a fair point, but a perms error is reported properly by pip.
>
> Is it? Last time I tried, I just got an uninformative error that the
> package installation failed. Admittedly that was probably a year or two
> ago, so maybe the error message has been improved.

Installs from wheels are not bad, as pip is in control of the whole
process. Installs from source are dreadful, because it's
setuptools/distutils that give the errors and pip can't do anything
more than report the tracebacks produced (we tried trimming junk and
summarising, and got lots of complaints about hiding the causes of
problems).

But pip's error reporting isn't wonderful. We do tend to spew out
tracebacks rather than user-friendly messages. It's usually easy
enough to work out what the common tracebacks mean, but they are still
an intimidating wall of text to a non-expert. The usual "contributions
accepted" applies here, as pip developer time is extremely limited,
but it's not going to be an easy task for anyone.

Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-12 Thread Tim Golden

On 12/01/2018 08:47, Paul Moore wrote:

On 12 January 2018 at 01:21, bartc  wrote:

On 11/01/2018 23:23, Chris Angelico wrote:


On Fri, Jan 12, 2018 at 10:11 AM, bartc  wrote:




I'm almost ready to plonk you, but I think there is still SOME value
in your posts. But please, stop denigrating what you don't understand.



And please try to see things from the pointer of view of a beginner or
outsider, where anything to do with Python seems to have a bewildering and
conflicting array of solutions.


The beginners I've worked with downloaded Python 3.6 and did "pip
install numpy", successfully and without help from me. Sure, some
beginners have issues, but they are usually willing to be helped. To
be as aggressively resistant to the simplest suggestions the way
you're being isn't the behaviour of a beginner in my experience.


I think the shame here is that there is a learning opportunity on both 
sides. As Paul says: by and large, the huge amount of work which the 
Python Packaging team, especially the pip developers, have put in has 
paid off. It's now usually possible to say: "pip install XXX" and have 
it work out of the box for any recentish version of Python on any 
recentish version of a mainstream OS. Once people understand the basics 
of using that "interface", many things become simple.


Unfortunately, where that *doesn't* work, it probably won't be because 
of low-hanging fruit: it'll be because of some strange interaction of 
different versions, odd leftover PATH setups, obscure Windows C Runtime 
redistribution issues, poor encoding interactions between Python and the 
Windows console, and so on.


All of these admit of solutions (if only by way of more informative 
error messages and useful FAQs) but they take time and patience to 
reproduce and work through. Many people -- and especially beginners -- 
don't really have the time or the inclination to follow through. They're 
not really interested in the mechanics of pip or the interaction of 
Python with the Windows installation subsystem. They just want to use 
numpy or pygame, or whatever.


Where there *are* people who are willing to take the time to work things 
through, we [the Python community and especially the packaging/pip crew] 
can welcome them and try to identify weak spots in our own story. But of 
course we react poorly if someone wants merely to dismiss stuff. 
(Typical tweet: "Sigh; Python packaging is still broken!").


I've actually been installing pygame quite a few times recently as part 
of a Coding Dojo I help to run once a term at a school in South London. 
And, even with the wonderful packaging work which the pygame guys have 
done to get wheels on PyPI, it's still sometimes a little painful. Of 
course, in that context, I'm just hustling to get people up-and-running 
and I'll do whatever it takes without stopping to take notes. So I 
sympathise when people say it's not easy for them. But not when they're 
dismissive about it.


TJG
--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-12 Thread Paul Moore
On 12 January 2018 at 01:21, bartc  wrote:
> On 11/01/2018 23:23, Chris Angelico wrote:
>>
>> On Fri, Jan 12, 2018 at 10:11 AM, bartc  wrote:
>
>
>> I'm almost ready to plonk you, but I think there is still SOME value
>> in your posts. But please, stop denigrating what you don't understand.
>
>
> And please try to see things from the pointer of view of a beginner or
> outsider, where anything to do with Python seems to have a bewildering and
> conflicting array of solutions.

The beginners I've worked with downloaded Python 3.6 and did "pip
install numpy", successfully and without help from me. Sure, some
beginners have issues, but they are usually willing to be helped. To
be as aggressively resistant to the simplest suggestions the way
you're being isn't the behaviour of a beginner in my experience.

Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-12 Thread Monte Milanuk

On 2018-01-11 12:37, Oivvio Polite wrote:

On ons, jan 10, 2018 at 01:40:28 +0100, Jan Erik Moström wrote:

I'm looking for a really easy to use graphic library. The target users are
teachers who have never programmed before and is taking a first (and
possible last) programming course.



I do a two day workshop for design and illustration students once a year
and use Processing (https://processing.org) for it. It's a programming
tool primarly for visual artists. The original version uses a subset of
Java but there is also a python mode (https://py.processing.org). I've
found it quite appropriate for an educational setting.




I was going to suggest p5.js... the tutorials on YouTube under 'The 
Coding Train' are pretty helpful.


--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-12 Thread Chris Angelico
On Fri, Jan 12, 2018 at 5:45 PM, Steven D'Aprano
 wrote:
> On Fri, 12 Jan 2018 12:14:03 +1100, Chris Angelico wrote:
>>> How do I deal with permissions errors? [semi-rhetorical question -- I
>>> know *an* answer, but I don't know if it is the *right* answer]
>>
>> That's a fair point, but a perms error is reported properly by pip.
>
> Is it? Last time I tried, I just got an uninformative error that the
> package installation failed. Admittedly that was probably a year or two
> ago, so maybe the error message has been improved.

Hmm. Last time I tried, it was pretty informative, but that was on
Linux. I actually don't know about Windows, and whether there are
weird situations that would result in obscure messages. Would have to
get someone to try it.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-12 Thread Christian Gollwitzer

Am 11.01.18 um 06:16 schrieb Michael Torrie:

On 01/10/2018 01:13 PM, bartc wrote:

I couldn't see anything obviously simple there. A lot seems to do with
interaction which is always much more complicated than just drawing stuff.


Yes the link didn't have the simple examples I hoped for.  How's this:
-
import pygame
import time

pygame.init()
screen = pygame.display.set_mode((1024, 768) )
red = (255,0,0)
green = (0,255,0)

screen.fill( (255,255,255) )
pygame.draw.lines(screen, red, False, ((0,0),(100,100)))
pygame.draw.lines(screen, green, False, ((0,100),(100,0)))
pygame.display.update()

time.sleep(5)
pygame.quit()
--


This looks very reasonable. If one wants buttons, however, I still 
recommend to use Tkinter. The same program looks not much more complex:


--
import tkinter as Tk
from tkinter import ttk
# Boilerplate: set up a resizeable canvas in a window
root   = Tk.Tk()
canvas = Tk.Canvas(root)
canvas.pack(expand=True, fill='both')


canvas.create_line(0, 0, 100, 100, fill='red')
canvas.create_line(0, 100, 100, 0, fill='green')

# add a button to close the program
button = ttk.Button(root, text='Leave', command=exit)
button.pack()

# run the program
Tk.mainloop()
---

The boilerplate looks a bit less intuitive - instead of pygame.init() 
you have to set up a canvas in a window - but the actual drawing code 
looks quite similar. And it is trivial to add a button or other widgets, 
as shown above.


Christian
--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Steven D'Aprano
On Fri, 12 Jan 2018 12:45:04 +1300, Gregory Ewing wrote:

> Seems to me it would help if pip were to announce which version of
> Python it's installing things into. And instead of just saying "not
> compatible with this version of Python", say "not compatible with Python
> X.Y.Z". That would make these kinds of problems much easier to diagnose.

This.

If pip is joined at the hip to a specific version of Python, I think that 
we ought to be able to specify the version number like we can with Python.

Something like:

pip ...  # use whichever version of pip comes first on the PATH
pip3.6 ...  # use the pip installed with Python 3.6
pip2.7 ...  # use the pip installed with Python 2.7

etc.

And don't say "use a venv" :-)


-- 
Steven D'Aprano

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Jan Erik Moström

On 10 Jan 2018, at 13:40, Jan Erik Moström wrote:

I'm looking for a really easy to use graphic library. The target users 
are teachers who have never programmed before and is taking a first 
(and possible last) programming course.


Thanks for all the suggestions, I'm going to take a look at them and see 
what fits my requirements best.


Thanks,
= jem
--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Steven D'Aprano
On Fri, 12 Jan 2018 12:14:03 +1100, Chris Angelico wrote:

> On Fri, Jan 12, 2018 at 11:57 AM, Steven D'Aprano
>  wrote:
[...]
>> Recent Pythons include "ensure pip" by default, which is a private
>> version of pip which is intended to do nothing but install the latest
>> version of pip.
> 
> True, but a fresh installation on Windows is supposed to let you just
> leave the box ticked and it runs ensurepip so you have pip.

Ah, didn't know that. Thanks.


[...]
>> How do you know which version of Python `pip install foo` will use? How
>> do I choose the version pip will install into? [not rhetorical
>> questions] Don't say "use venv", because using a virtual environment
>> shouldn't be a prerequisite for using pip.
> 
> The recommendation was already given to use "python3 -m pip". That gets
> around those problems.

If you google for installation instructions, they're nearly always given 
in terms of "use pip", not "use python3.4 -m pip".

My point isn't that there is *no* solution to this problem, but that its 
not necessarily an *obvious* solution.


[...]
>> How do I deal with permissions errors? [semi-rhetorical question -- I
>> know *an* answer, but I don't know if it is the *right* answer]
> 
> That's a fair point, but a perms error is reported properly by pip.

Is it? Last time I tried, I just got an uninformative error that the 
package installation failed. Admittedly that was probably a year or two 
ago, so maybe the error message has been improved.


> How
> do you deal with it? First you recognize that there's a problem. Nothing
> in this thread suggested that there were perms problems to deal with.

Indeed. For somebody who claims to be such an experienced developer, Bart 
is sure dedicated to the ideas that:

1. you ought to be able to install software without knowing anything at 
all about the operating system, the software being installed, or the 
installer.

2. If you run into an installation problem, it means the programming 
language sucks, not that you've done something wrong.

3. And you absolutely *shouldn't* ask for help or give sufficient details 
of what went wrong to allow others to diagnose the fault. Instead you 
should just *hint* at the error and make it out to be a systematic 
problem with the language itself.



"Make it easy to install it" -- I'm 100% in agreement with that.

"A literal brain-damaged monkey in a coma should be able to install it" 
-- not so much.



-- 
Steve

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Terry Reedy

On 1/11/2018 6:35 PM, Gregory Ewing wrote:

bartc wrote:
I downloaded Python 3.7. It didn't work. I uninstalled and reinstalled 
it, this time with the 'set environment variables' option (to allow 
'pip' to be typed from anywhere).


I suspect some of your problems might have been caused
by 'pip' not using the Python you thought it was using.

If you have multiple versions of Python floating around,
it's hard to be sure exactly which version a bare 'pip'
command is going to use.

I recommend making it explicit by doing this instead:

\python.exe -m pip install ...


On Windows, the easy and recommended way to be 'explicit' is, at worst, 
'py -x.y'.



--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Terry Reedy

On 1/11/2018 3:34 PM, Dietmar Schwertberger wrote:

On 1/11/2018 8:51 PM, bartc wrote:
I downloaded Python 3.7. It didn't work. I uninstalled and reinstalled 
it, this time with the 'set environment variables' option (to allow 
'pip' to be typed from anywhere). 


You can't expect that people provide binary installers for Python 
versions that are alpha.


In fact, https://www.lfd.uci.edu/~gohlke/pythonlibs/
does have such for 3.7, 'as is', for the adventurous or the proactive, 
for perhaps half of 100s of packages covered there.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Terry Reedy

On 1/11/2018 2:51 PM, bartc wrote:

I downloaded Python 3.7. It didn't work. I uninstalled and reinstalled 
it, this time with the 'set environment variables' option (to allow 
'pip' to be typed from anywhere).


The recommended way to run pip and similar python code is
 -m pip install xyz

where  invokes a specific python binary on the particular 
machine.  For example, on Windows 10 with amd64 binaries installed.


C:\Users\Terry>py -3.6 -m pip install pygame
Collecting pygame
  Downloading pygame-1.9.3-cp36-cp36m-win_amd64.whl (4.2MB)
100% || 4.2MB 267kB/s
Installing collected packages: pygame
Successfully installed pygame-1.9.3

Notice the name of the .whl file!!!


It still didn't work. I hid all the other Pythons. Same thing.

The following is the transcript.

c:\python37>pip install pygame
Collecting pygame
   Using cached pygame-1.9.3.tar.gz


I believe that this is a compressed source archive that requires a C 
compiler for any C files.  Mainly intended for *nix, not Windows.  Pip 
should only try it after failing to find the proper .whl.  Since pygame 
wraps a C library, but expects Windows users to use a specific .whl, I 
would not expect the .tar.gz to work on Windows even if you had the 
required Microsoft C++ compiler.


The pygame people have not yet put a 3.7 windows .whl file on PyPI. 
There *is* a 3.7 pygame .whl

pygame‑1.9.3‑cp37‑cp37m‑win_amd64.whl
with Windows binaries at the site previously recommended in this thread:
https://www.lfd.uci.edu/~gohlke/pythonlibs/
It can be downloaded manually and installed with a variant pip command, 
as explained at the top of the page.  (C. Gohlke does us a great service 
by providing test binaries while a version is still in development.)


> What is this "Setup" file of which it speaks?

A file with info needed to compile C files and then install everything.

Terry Jan Reedy


--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Ned Batchelder

On 1/11/18 8:21 PM, bartc wrote:

On 11/01/2018 23:23, Chris Angelico wrote:

On Fri, Jan 12, 2018 at 10:11 AM, bartc  wrote:



I'm almost ready to plonk you, but I think there is still SOME value
in your posts. But please, stop denigrating what you don't understand.


And please try to see things from the pointer of view of a beginner or 
outsider, where anything to do with Python seems to have a bewildering 
and conflicting array of solutions.




Bart, we get it. You don't like Python, it doesn't work the way you 
expect. While I appreciate your optimism at continuing to try it, please 
just stop.  We don't need yet another thread where you try things, and 
they don't work, and we try to explain it, and you tell us it's too 
complicated and could be simpler. We've heard it all before, and it 
doesn't get us anywhere, and it doesn't educate anybody.


The Python packaging ecosystem is complex, it's true. You don't need to 
use it.  You'll be happier with other things.


Everyone else: please resist the temptation to argue with Bart about 
these things.  It's not doing anyone any good.


--Ned.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Chris Angelico
On Fri, Jan 12, 2018 at 12:21 PM, bartc  wrote:
> On 11/01/2018 23:23, Chris Angelico wrote:
>>
>> On Fri, Jan 12, 2018 at 10:11 AM, bartc  wrote:
>
>
>> I'm almost ready to plonk you, but I think there is still SOME value
>> in your posts. But please, stop denigrating what you don't understand.
>
>
> And please try to see things from the pointer of view of a beginner or
> outsider, where anything to do with Python seems to have a bewildering and
> conflicting array of solutions.
>
You mean the sort of person who goes to the front page and sees just
two options, 2.7 and 3.6, and won't see anything about 3.7 until it's
released? Again, a number of people have put in a lot of hours to make
that easy.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread bartc

On 11/01/2018 23:23, Chris Angelico wrote:

On Fri, Jan 12, 2018 at 10:11 AM, bartc  wrote:



I'm almost ready to plonk you, but I think there is still SOME value
in your posts. But please, stop denigrating what you don't understand.


And please try to see things from the pointer of view of a beginner or 
outsider, where anything to do with Python seems to have a bewildering 
and conflicting array of solutions.


--
bartc
--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Chris Angelico
On Fri, Jan 12, 2018 at 11:57 AM, Steven D'Aprano
 wrote:
> On Fri, 12 Jan 2018 05:42:03 +1100, Chris Angelico wrote:
>
>> On Fri, Jan 12, 2018 at 5:33 AM, bartc  wrote:
> [...]
>>> Except my Python 3.6 doesn't have pip. There is a however a copy in my
>>> Python 3.4. But that gives me the message:
>>
>> Why doesn't it? Recent Pythons should include pip by default.
>
> Not quite.
>
> Recent Pythons include "ensure pip" by default, which is a private
> version of pip which is intended to do nothing but install the latest
> version of pip.

True, but a fresh installation on Windows is supposed to let you just
leave the box ticked and it runs ensurepip so you have pip.

>> If you've broken your pip in some way, we won't be able to help you
>> debug it with just this. Figure out why your Python 3.6 doesn't have a
>> working pip, because that IS the normal and obvious thing to do.
>
> Just because you have installed Python doesn't mean that pip will be
> automatically installed and `pip ...` work from the shell.
>
> There's also the problem that while you can easily install multiple
> versions of Python without them clashing, the same doesn't apply to "pip".
>
> How do you know which version of Python `pip install foo` will use? How
> do I choose the version pip will install into? [not rhetorical questions]
> Don't say "use venv", because using a virtual environment shouldn't be a
> prerequisite for using pip.

The recommendation was already given to use "python3 -m pip". That
gets around those problems.

> How do I deal with permissions errors? [semi-rhetorical question -- I
> know *an* answer, but I don't know if it is the *right* answer]

That's a fair point, but a perms error is reported properly by pip.
How do you deal with it? First you recognize that there's a problem.
Nothing in this thread suggested that there were perms problems to
deal with.

> I keep hearing people say that pip is the greatest thing since sliced
> bread, but my own personal experience with it is that installing pip is
> only half the battle.
>
> If it works for you, great -- but some of us have had so many problems
> getting pip to work that we've gone back to just installing from source.
>
> (Admittedly installing from source is probably harder for Windows users
> than Linux users.)

Correct. On Windows, I don't know of ANYONE who installs packages from
source who is not already a Python developer. You don't just revert to
source when pip starts having issues.

I wouldn't say that pip is perfect - there are certainly a number of
issues with it (some of which are NOT issues with similar programs
like npm (Node), gem (Ruby), etc - so there's things pip can perhaps
learn from them) - but it is far easier than the Windows alternative,
which is "track down a binary, make sure it matches your Python, and
then install it".

(Pure Python packages are much easier, but pygame is an extension and
has to be compiled. So do many others.)

Compiling software from source is reasonably common among Linux users,
so it's unsurprising for us to go "oh, I need those dev libraries".
When I wanted to spin up Jekyll to do local testing prior to pushing
stuff to GitHub Pages, I followed the directions, then got an error
that required me to install the Ruby dev headers, and that didn't faze
me. But if someone on Windows had the same problem, it'd likely be a
much bigger deal - firstly because you can't just "sudo apt install
ruby-dev", and secondly because Windows systems usually don't have a C
compiler installed. I'm massively overgeneralizing here, but if you
were to poll a thousand Linux users and a thousand Windows users,
you'd find a far higher proportion of the former are comfortable
building random software from source.

But even with that caveat, I still think pip is worth using *on
Linux*. For your system Python, use your system package manager; for a
Python installed from source, use pip.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Steven D'Aprano
On Fri, 12 Jan 2018 05:42:03 +1100, Chris Angelico wrote:

> On Fri, Jan 12, 2018 at 5:33 AM, bartc  wrote:
[...]
>> Except my Python 3.6 doesn't have pip. There is a however a copy in my
>> Python 3.4. But that gives me the message:
> 
> Why doesn't it? Recent Pythons should include pip by default.

Not quite.

Recent Pythons include "ensure pip" by default, which is a private 
version of pip which is intended to do nothing but install the latest 
version of pip.


> If you've broken your pip in some way, we won't be able to help you
> debug it with just this. Figure out why your Python 3.6 doesn't have a
> working pip, because that IS the normal and obvious thing to do.

Just because you have installed Python doesn't mean that pip will be 
automatically installed and `pip ...` work from the shell.

There's also the problem that while you can easily install multiple 
versions of Python without them clashing, the same doesn't apply to "pip".

How do you know which version of Python `pip install foo` will use? How 
do I choose the version pip will install into? [not rhetorical questions] 
Don't say "use venv", because using a virtual environment shouldn't be a 
prerequisite for using pip.

How do I deal with permissions errors? [semi-rhetorical question -- I 
know *an* answer, but I don't know if it is the *right* answer]

I keep hearing people say that pip is the greatest thing since sliced 
bread, but my own personal experience with it is that installing pip is 
only half the battle.

If it works for you, great -- but some of us have had so many problems 
getting pip to work that we've gone back to just installing from source.

(Admittedly installing from source is probably harder for Windows users 
than Linux users.)



-- 
Steve

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Gregory Ewing

Ned Batchelder wrote:
so "pip install pygame" should work.  Some people seem so 
determined to dislike a thing, they cannot be convinced there are 
solutions to their problems.


But it clearly didn't work for bartc at first, and the
error messages he got didn't make it at all clear why.
You can't blame him for that.

My theory is that his 'pip' command was picking up
some version of Python other than 3.4 or 3.6, and
when he re-installed 3.6, it changed his path so that
it now referred to the 3.6 version of pip.

Seems to me it would help if pip were to announce
which version of Python it's installing things into.
And instead of just saying "not compatible with
this version of Python", say "not compatible with
Python X.Y.Z". That would make these kinds of problems
much easier to diagnose.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Gregory Ewing

bartc wrote:
I downloaded Python 3.7. It didn't work. I uninstalled and reinstalled 
it, this time with the 'set environment variables' option (to allow 
'pip' to be typed from anywhere).


I suspect some of your problems might have been caused
by 'pip' not using the Python you thought it was using.

If you have multiple versions of Python floating around,
it's hard to be sure exactly which version a bare 'pip'
command is going to use.

I recommend making it explicit by doing this instead:

\python.exe -m pip install ...

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread MRAB

On 2018-01-11 23:11, bartc wrote:

On 11/01/2018 22:32, Chris Angelico wrote:

On Fri, Jan 12, 2018 at 9:21 AM, bartc  wrote:



As I understand it, pygame is just another add-on, which doesn't inherently
need to use .whl format, and which doesn't inherently need to use 'pip'
package installer. I even saw somewhere that you needed to use 'pip install
wheel' in order to use .whl.

So there are two extraneous package systems to contend with, which
themselves need to be the correct versions, before it can even start
thinking about installing the product you really want.



More FUD. Especially when you preface something with "I even saw
somewhere". No reference, and it's not something from official
documentation.


Why, you don't believe me? It was here:
http://www.pygame.org/download.shtml, the last comment under 1.9.3.

I think the "wheel" might just be a placeholder for the name of the 
wheel itself.


Anyway, it's available on PyPI as a wheel, so you can use pip.

To install on Python 3.6 from PyPI, it's:

py -3.6 -m pip pygame

from the command line.


   You're citing a potentially-outdated third-party

document, and ignoring context (like "you need to 'pip install wheel'
to take advantage of wheel caching" which is not nearly as bad as
you're implying).


What have pip and wheels got to do with pygame? Nothing.


They are a way to install it.


You said yourself that when you used Python 3.6 (the latest stable
release, at time of writing), everything just worked. Why are you
still complaining?


I like exploring complexity, and the gratuitous use of it.

The subject is a Simple graphic library, for a language which is widely
regarded (erroneously IMO) as also being simple.


--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Chris Angelico
On Fri, Jan 12, 2018 at 10:11 AM, bartc  wrote:
> On 11/01/2018 22:32, Chris Angelico wrote:
>>
>> On Fri, Jan 12, 2018 at 9:21 AM, bartc  wrote:
>
>
>>> As I understand it, pygame is just another add-on, which doesn't
>>> inherently
>>> need to use .whl format, and which doesn't inherently need to use 'pip'
>>> package installer. I even saw somewhere that you needed to use 'pip
>>> install
>>> wheel' in order to use .whl.
>>>
>>> So there are two extraneous package systems to contend with, which
>>> themselves need to be the correct versions, before it can even start
>>> thinking about installing the product you really want.
>
>
>> More FUD. Especially when you preface something with "I even saw
>> somewhere". No reference, and it's not something from official
>> documentation.
>
>
> Why, you don't believe me? It was here:
> http://www.pygame.org/download.shtml, the last comment under 1.9.3.

You didn't say that in your first email, so no, I don't believe it
until I get a citation. "I even saw somewhere" is pure FUD, whether
there's something to back it or not. How is anyone supposed to know
whether it's true or not?

What you're reading is a comment that, instead of downloading this
way, you can simply use pip to get pygame. Which is what you should be
doing.

>  You're citing a potentially-outdated third-party
>>
>> document, and ignoring context (like "you need to 'pip install wheel'
>> to take advantage of wheel caching" which is not nearly as bad as
>> you're implying).
>
>
> What have pip and wheels got to do with pygame? Nothing.

They're the easiest and best way to install stuff.

>> You said yourself that when you used Python 3.6 (the latest stable
>> release, at time of writing), everything just worked. Why are you
>> still complaining?
>
>
> I like exploring complexity, and the gratuitous use of it.
>
> The subject is a Simple graphic library, for a language which is widely
> regarded (erroneously IMO) as also being simple.

I'm almost ready to plonk you, but I think there is still SOME value
in your posts. But please, stop denigrating what you don't understand.
Take an attitude that there is logic and value in things even when you
don't understand them yet. Do you realize how insulting you are being
to the people who have put INSANE amounts of work into improving
Python packaging and making it easy to install things?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread bartc

On 11/01/2018 22:32, Chris Angelico wrote:

On Fri, Jan 12, 2018 at 9:21 AM, bartc  wrote:



As I understand it, pygame is just another add-on, which doesn't inherently
need to use .whl format, and which doesn't inherently need to use 'pip'
package installer. I even saw somewhere that you needed to use 'pip install
wheel' in order to use .whl.

So there are two extraneous package systems to contend with, which
themselves need to be the correct versions, before it can even start
thinking about installing the product you really want.



More FUD. Especially when you preface something with "I even saw
somewhere". No reference, and it's not something from official
documentation.


Why, you don't believe me? It was here: 
http://www.pygame.org/download.shtml, the last comment under 1.9.3.


 You're citing a potentially-outdated third-party

document, and ignoring context (like "you need to 'pip install wheel'
to take advantage of wheel caching" which is not nearly as bad as
you're implying).


What have pip and wheels got to do with pygame? Nothing.


You said yourself that when you used Python 3.6 (the latest stable
release, at time of writing), everything just worked. Why are you
still complaining?


I like exploring complexity, and the gratuitous use of it.

The subject is a Simple graphic library, for a language which is widely 
regarded (erroneously IMO) as also being simple.


--
bartc

--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Chris Angelico
On Fri, Jan 12, 2018 at 9:21 AM, bartc  wrote:
> On 11/01/2018 20:53, Chris Angelico wrote:
>>
>> On Fri, Jan 12, 2018 at 7:34 AM, bartc  wrote:
>
>
>>> It failed on my 3.6, it failed on 3.4, it failed on 3.7 (is what 'pip'
>>> does
>>> really so leading edge?), and finally worked on a brand-new 3.6.
>>
>>
>> In case you haven't figured it out by now, pygame has different builds
>> to work with different versions. So what you're saying is:
>>
>> "Wow, the pygame people are lazy idiots who haven't made things easy
>> for me to use an unreleased version of Python. What a train-wreck
>> Python is, when third-party packages aren't ready months in advance of
>> a new release."
>
>
>  "pygame for Python version 3.7 and later not ready."
>
> or:
>
>  "Can't find pygame distribution for Python 3.7."
>
> If this works by accessing the right version of a .whl file, then it might
> guess something is amiss if there isn't one available for 3.7.
>
> But the error message for 'pip install pygame' on 3.7 was roughly the same
> as on 3.4.
>
> As I understand it, pygame is just another add-on, which doesn't inherently
> need to use .whl format, and which doesn't inherently need to use 'pip'
> package installer. I even saw somewhere that you needed to use 'pip install
> wheel' in order to use .whl.
>
> So there are two extraneous package systems to contend with, which
> themselves need to be the correct versions, before it can even start
> thinking about installing the product you really want.
>
> And pygame itself, as I think was mentioned, is largely a wrapper around
> SDL. SDL for Windows can come prebuilt as a handful of .dll shared
> libraries. But a wrapper that presumably isn't written in Python, for the
> most part, according to the preponderance of .pyd modules. Its
> implementation is messy, and its distribution seems rather more elaborate
> (when the magic doesn't work and things go wrong) than is necessary.
>

More FUD. Especially when you preface something with "I even saw
somewhere". No reference, and it's not something from official
documentation. You're citing a potentially-outdated third-party
document, and ignoring context (like "you need to 'pip install wheel'
to take advantage of wheel caching" which is not nearly as bad as
you're implying).

You said yourself that when you used Python 3.6 (the latest stable
release, at time of writing), everything just worked. Why are you
still complaining?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread bartc

On 11/01/2018 20:53, Chris Angelico wrote:

On Fri, Jan 12, 2018 at 7:34 AM, bartc  wrote:



It failed on my 3.6, it failed on 3.4, it failed on 3.7 (is what 'pip' does
really so leading edge?), and finally worked on a brand-new 3.6.


In case you haven't figured it out by now, pygame has different builds
to work with different versions. So what you're saying is:

"Wow, the pygame people are lazy idiots who haven't made things easy
for me to use an unreleased version of Python. What a train-wreck
Python is, when third-party packages aren't ready months in advance of
a new release."


 "pygame for Python version 3.7 and later not ready."

or:

 "Can't find pygame distribution for Python 3.7."

If this works by accessing the right version of a .whl file, then it 
might guess something is amiss if there isn't one available for 3.7.


But the error message for 'pip install pygame' on 3.7 was roughly the 
same as on 3.4.


As I understand it, pygame is just another add-on, which doesn't 
inherently need to use .whl format, and which doesn't inherently need to 
use 'pip' package installer. I even saw somewhere that you needed to use 
'pip install wheel' in order to use .whl.


So there are two extraneous package systems to contend with, which 
themselves need to be the correct versions, before it can even start 
thinking about installing the product you really want.


And pygame itself, as I think was mentioned, is largely a wrapper around 
SDL. SDL for Windows can come prebuilt as a handful of .dll shared 
libraries. But a wrapper that presumably isn't written in Python, for 
the most part, according to the preponderance of .pyd modules. Its 
implementation is messy, and its distribution seems rather more 
elaborate (when the magic doesn't work and things go wrong) than is 
necessary.



--
bartc
--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread breamoreboy
On Thursday, January 11, 2018 at 8:34:30 PM UTC, bartc wrote:
> On 11/01/2018 20:12, Chris Angelico wrote:
> > On Fri, Jan 12, 2018 at 7:02 AM, bartc  wrote:
> >> On 11/01/2018 19:41, Paul Moore wrote:
> >>>
> >>> On 11 January 2018 at 18:33, bartc  wrote:
> >>
> >>
> >>>   python -m pip install XXX
> >>>
> >>> just works, for 99% of things anyone wants. In particular it works for
> >>> pygame.
> >>>
> >>> Continuing to complain about a situation that has been resolved for a
> >>> year or more
> >>
> >>
> >> I tried that on my brand-new, just installed Python 3.7. It didn't work as
> >> detailed in my other post.
> >>
> >> Please don't assume that because it works for you, that it MUST work for
> >> everyone, and that they must be doing something wrong if it doesn't.
> >>
> >> Apparently it's missing a file called 'Setup'. Is it my fault if it can't
> >> find it? Or if it insists on continuing to install something even when some
> >> vital component is missing.
> >>
> > 
> > Most people would use the latest STABLE RELEASE of a language, if they
> > expect it to be stable. Unreleased versions, alphas, and so on, may be
> > very useful, but should not be expected to work perfectly with all
> > third-party modules.
> 
> 
>  >> I downloaded Python 3.7. It didn't work.
>  >
>  > Where from?
> 
> I found it at www.python.org. (in /downloads/windows). Although it said 
> 'latest' release was 3.6.4, it didn't say anything about 3.7 being alpha 
> or beta release.
> 

>From [1] the title is "[RELEASE] Python 3.7.0a4 is now available for testing".

The full text is:-


Python 3.7.0a4 is the last of four planned alpha releases of Python 3.7,
the next feature release of Python.  During the alpha phase, Python 3.7
remains under heavy development: additional features will be added
and existing features may be modified or deleted.  Please keep in mind
that this is a preview release and its use is not recommended for
production environments.  The next preview release, 3.7.0b1, is planned
for 2018-01-29. You can find Python 3.7.0a4 and more information here:

https://www.python.org/downloads/release/python-370a4/


The link is dated Tue Jan 9 10:48:01 EST 2018, two whole days ago.

[1]https://mail.python.org/pipermail/python-list/2018-January/729985.html

--
Kindest regards.

Mark Lawrence.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Chris Angelico
On Fri, Jan 12, 2018 at 7:34 AM, bartc  wrote:
> On 11/01/2018 20:12, Chris Angelico wrote:
>>
>> On Fri, Jan 12, 2018 at 7:02 AM, bartc  wrote:
>>>
>>> On 11/01/2018 19:41, Paul Moore wrote:


 On 11 January 2018 at 18:33, bartc  wrote:
>>>
>>>
>>>
   python -m pip install XXX

 just works, for 99% of things anyone wants. In particular it works for
 pygame.

 Continuing to complain about a situation that has been resolved for a
 year or more
>>>
>>>
>>>
>>> I tried that on my brand-new, just installed Python 3.7. It didn't work
>>> as
>>> detailed in my other post.
>>>
>>> Please don't assume that because it works for you, that it MUST work for
>>> everyone, and that they must be doing something wrong if it doesn't.
>>>
>>> Apparently it's missing a file called 'Setup'. Is it my fault if it can't
>>> find it? Or if it insists on continuing to install something even when
>>> some
>>> vital component is missing.
>>>
>>
>> Most people would use the latest STABLE RELEASE of a language, if they
>> expect it to be stable. Unreleased versions, alphas, and so on, may be
>> very useful, but should not be expected to work perfectly with all
>> third-party modules.
>
>
>
>>> I downloaded Python 3.7. It didn't work.
>>
>> Where from?
>
> I found it at www.python.org. (in /downloads/windows). Although it said
> 'latest' release was 3.6.4, it didn't say anything about 3.7 being alpha or
> beta release.

So:
1) You ignore the homepage download link
2) You ignore the /downloads/ info
3) You ignore the fact that the version number is 3.7.0a4
4) You didn't actually go to
https://www.python.org/downloads/release/python-370a4/ where you would
have seen that it's a preview.

> It failed on my 3.6, it failed on 3.4, it failed on 3.7 (is what 'pip' does
> really so leading edge?), and finally worked on a brand-new 3.6.

In case you haven't figured it out by now, pygame has different builds
to work with different versions. So what you're saying is:

"Wow, the pygame people are lazy idiots who haven't made things easy
for me to use an unreleased version of Python. What a train-wreck
Python is, when third-party packages aren't ready months in advance of
a new release."

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Dietmar Schwertberger

On 1/11/2018 8:51 PM, bartc wrote:
I downloaded Python 3.7. It didn't work. I uninstalled and reinstalled 
it, this time with the 'set environment variables' option (to allow 
'pip' to be typed from anywhere). 


You can't expect that people provide binary installers for Python 
versions that are alpha.


Why not try a released version?
You can see on https://pypi.python.org/pypi/Pygame that there are wheels 
for e.g. Python 3.6, 3.5, 3.4, 2.7.
Other versions will be built from sources and this is certainl more 
complicated...
(I have not tried it myself. There might be dependencies to other 
binaries like a SDL binary installation.)


Regards,

Dietmar

--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Oivvio Polite
On ons, jan 10, 2018 at 01:40:28 +0100, Jan Erik Moström wrote:
> I'm looking for a really easy to use graphic library. The target users are
> teachers who have never programmed before and is taking a first (and
> possible last) programming course.
> 

I do a two day workshop for design and illustration students once a year
and use Processing (https://processing.org) for it. It's a programming
tool primarly for visual artists. The original version uses a subset of
Java but there is also a python mode (https://py.processing.org). I've
found it quite appropriate for an educational setting. 

regards, Oivvio
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread bartc

On 11/01/2018 20:12, Chris Angelico wrote:

On Fri, Jan 12, 2018 at 7:02 AM, bartc  wrote:

On 11/01/2018 19:41, Paul Moore wrote:


On 11 January 2018 at 18:33, bartc  wrote:




  python -m pip install XXX

just works, for 99% of things anyone wants. In particular it works for
pygame.

Continuing to complain about a situation that has been resolved for a
year or more



I tried that on my brand-new, just installed Python 3.7. It didn't work as
detailed in my other post.

Please don't assume that because it works for you, that it MUST work for
everyone, and that they must be doing something wrong if it doesn't.

Apparently it's missing a file called 'Setup'. Is it my fault if it can't
find it? Or if it insists on continuing to install something even when some
vital component is missing.



Most people would use the latest STABLE RELEASE of a language, if they
expect it to be stable. Unreleased versions, alphas, and so on, may be
very useful, but should not be expected to work perfectly with all
third-party modules.



>> I downloaded Python 3.7. It didn't work.
>
> Where from?

I found it at www.python.org. (in /downloads/windows). Although it said 
'latest' release was 3.6.4, it didn't say anything about 3.7 being alpha 
or beta release.


I chose 3.7 as I didn't want to uninstall 3.6 or risk any 
cross-contamination from it if it had issues.


But I've since installed 3.6.4, replacing my 3.6.1, and that finally 
works, in installing pygame.


As I said however, it was a bigger obstacle than actually programming 
any graphics, and has taken up nearly half the thread.


It failed on my 3.6, it failed on 3.4, it failed on 3.7 (is what 'pip' 
does really so leading edge?), and finally worked on a brand-new 3.6.


(But still no trace of that mysterious "Setup" file.)

--
bartc
--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Chris Angelico
On Fri, Jan 12, 2018 at 7:02 AM, bartc  wrote:
> On 11/01/2018 19:41, Paul Moore wrote:
>>
>> On 11 January 2018 at 18:33, bartc  wrote:
>
>
>>  python -m pip install XXX
>>
>> just works, for 99% of things anyone wants. In particular it works for
>> pygame.
>>
>> Continuing to complain about a situation that has been resolved for a
>> year or more
>
>
> I tried that on my brand-new, just installed Python 3.7. It didn't work as
> detailed in my other post.
>
> Please don't assume that because it works for you, that it MUST work for
> everyone, and that they must be doing something wrong if it doesn't.
>
> Apparently it's missing a file called 'Setup'. Is it my fault if it can't
> find it? Or if it insists on continuing to install something even when some
> vital component is missing.
>

Most people would use the latest STABLE RELEASE of a language, if they
expect it to be stable. Unreleased versions, alphas, and so on, may be
very useful, but should not be expected to work perfectly with all
third-party modules.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread bartc

On 11/01/2018 19:41, Paul Moore wrote:

On 11 January 2018 at 18:33, bartc  wrote:



 python -m pip install XXX

just works, for 99% of things anyone wants. In particular it works for pygame.

Continuing to complain about a situation that has been resolved for a
year or more


I tried that on my brand-new, just installed Python 3.7. It didn't work 
as detailed in my other post.


Please don't assume that because it works for you, that it MUST work for 
everyone, and that they must be doing something wrong if it doesn't.


Apparently it's missing a file called 'Setup'. Is it my fault if it 
can't find it? Or if it insists on continuing to install something even 
when some vital component is missing.


--
bartc
--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Chris Angelico
On Fri, Jan 12, 2018 at 6:51 AM, bartc  wrote:
> On 11/01/2018 18:42, Chris Angelico wrote:
>>
>> On Fri, Jan 12, 2018 at 5:33 AM, bartc  wrote:
>
>
>>> Well, that seemed to do something, and it didn't need me to download any
>>> .whl files. But then I noticed a bunch of errors culminating with:
>>>
>>> "Command python setup.py egg_info failed with error code 1 in
>>> C:\Users\user\AppData\Local\Temp\pip_build_user\pygame"
>>
>>
>> If you've broken your pip in some way, we won't be able to help you
>> debug it with just this. Figure out why your Python 3.6 doesn't have a
>> working pip, because that IS the normal and obvious thing to do.
>
>
> I downloaded Python 3.7. It didn't work.

Where from?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Paul Moore
On 11 January 2018 at 19:51, bartc  wrote:
> I downloaded Python 3.7. It didn't work. I uninstalled and reinstalled it,
> this time with the 'set environment variables' option (to allow 'pip' to be
> typed from anywhere).

Stop trolling. Python 3.7 final hasn't been released yet. OF COURSE
you will hit problems.
Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread bartc

On 11/01/2018 18:42, Chris Angelico wrote:

On Fri, Jan 12, 2018 at 5:33 AM, bartc  wrote:



Well, that seemed to do something, and it didn't need me to download any
.whl files. But then I noticed a bunch of errors culminating with:

"Command python setup.py egg_info failed with error code 1 in
C:\Users\user\AppData\Local\Temp\pip_build_user\pygame"


If you've broken your pip in some way, we won't be able to help you
debug it with just this. Figure out why your Python 3.6 doesn't have a
working pip, because that IS the normal and obvious thing to do.


I downloaded Python 3.7. It didn't work. I uninstalled and reinstalled 
it, this time with the 'set environment variables' option (to allow 
'pip' to be typed from anywhere).


It still didn't work. I hid all the other Pythons. Same thing.

The following is the transcript. What is this "Setup" file of which it 
speaks?


-

c:\python37>pip install pygame
Collecting pygame
  Using cached pygame-1.9.3.tar.gz
Complete output from command python setup.py egg_info:


WARNING, No "Setup" File Exists, Running "config.py"
Using WINDOWS configuration...

Path for SDL not found.
Too bad that is a requirement! Hand-fix the "Setup"
Path for FONT not found.
Path for IMAGE not found.
Path for MIXER not found.
Path for PNG not found.
Path for JPEG not found.
Path for PORTMIDI not found.
Path for COPYLIB_tiff not found.
Path for COPYLIB_z not found.
Path for COPYLIB_vorbis not found.
Path for COPYLIB_ogg not found.

If you get compiler errors during install, doublecheck
the compiler flags in the "Setup" file.


Continuing With "setup.py"
Error with the "Setup" file,
perhaps make a clean copy from "Setup.in".
Traceback (most recent call last):
  File "", line 1, in 
  File 
"C:\Users\user\AppData\Local\Temp\pip-build-_pte0jsi\pygame\setup.py", 
line 165, in 
le>
extensions = read_setup_file('Setup')
  File "c:\python37\lib\distutils\extension.py", line 171, in 
read_setup_file

line = expand_makefile_vars(line, vars)
  File "c:\python37\lib\distutils\sysconfig.py", line 407, in 
expand_makefile_vars

s = s[0:beg] + vars.get(m.group(1)) + s[end:]
TypeError: can only concatenate str (not "NoneType") to str


Command "python setup.py egg_info" failed with error code 1 in 
C:\Users\user\AppData\Local\Temp\pip-

build-_pte0jsi\pygame\

c:\python37>

-

--
bartc
--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Paul Moore
On 11 January 2018 at 18:33, bartc  wrote:
>> Go. Fetch. Stop fudding.
>
> And you know this link, how? Because googling for 'download pygame', it
> doesn't appear on the first page (or in any of the next half dozen).

Using your search phrase, the first results I get are:

1. Downloads - Pygame
   Page says "Wheel packages are also available on PyPI, and may be
installed by running pip install wheel" right at the top, and that
works perfectly.
2. GettingStarted - pygame wiki
   The "Windows installation" section says quite clearly, "py -m pip
install pygame --user".

I don't know why you'd need to go further, both of those are official
pygame documentation, so it's reasonable to accept them as definitive.
Later hits include some out of date instructions that explain how
you'd have had to install pygame a few years ago, but why are you even
looking that far down the search results? Even Christoph Gohlke's
wheel distribution (which is what Chris was pointing you at) hasn't
been needed for about 12 months. Certainly finding and installing that
needs a bit of work, but it isn't needed any more. Life was harder a
year ago. So what? Be grateful for all the work done by people who
made it better.

Please stop perpetuating the myth that it's hard to install libraries
on Windows. It was in the past, sure. And there's a lot of out of date
information on the web. No-one who works on Python or its packaging
ecosystem can magically remove outdated information from the web. But
we *can* expect people to be careful not to trust out of date
information[1]. And by "out of date", think "over a year old". Pygame
wheels were available on PyPI about a year ago, and the official docs
at packaging.python.org and docs.python.org have been saying "do
python -m pip install XXX" for at least as long.

Nowadays,

python -m pip install XXX

just works, for 99% of things anyone wants. In particular it works for pygame.

Continuing to complain about a situation that has been resolved for a
year or more is fairly dismissive of the huge amount of work that a
lot of people have put in, free of charge, to improve Python's
packaging ecosystem over the last few years.

Paul

[1] If you were buying a new graphics card for your PC, would you rely
on reviews from 2 years ago? How about a new phone? And software
changes a lot faster than hardware...
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Chris Angelico
On Fri, Jan 12, 2018 at 5:33 AM, bartc  wrote:
> On 11/01/2018 15:23, Chris Angelico wrote:
>>
>> On Fri, Jan 12, 2018 at 12:38 AM, bartc  wrote:
>
>
>>> Although I can't run it because 'pygame' is not available. I think
>>> installing this library is likely to be a bigger obstacle than
>>> programming
>>> any graphics!
>>>
>>> (If I try and download it as a ready-built library for Windows, it has a
>>> range of .msi files, none of which is a match for my Python. The newest
>>> is
>>> for win32 Py3.2; I need win64 Py3.6. While building from source involves
>>> running MSVC 2008  urghh)
>>
>>
>> https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
>>
>> Go. Fetch. Stop fudding.
>
>
> And you know this link, how? Because googling for 'download pygame', it
> doesn't appear on the first page (or in any of the next half dozen).

I Googled 'pygame windows', 'pygame windows binary', and a few others
like that, and it appeared on the first page every time - usually
within the top four - and other hits often included Stack Overflow
questions that link to it, as well. A bit of basic research will also
tell you that this is a link worth saving.

> But clicking on it, the most promising link seems to have 'cp36' and
> 'amd64'; I assume the 36 means 3.6.
>
> OK, but what the hell do I do with a .whl file? Google tells me I install it
> something like this: pip install file.whl.
>
> Except my Python 3.6 doesn't have pip. There is a however a copy in my
> Python 3.4. But that gives me the message:

Why doesn't it? Recent Pythons should include pip by default.

>  "pygame-1.9.3-cp36-cp36m-win_amd64.whl is not a supported wheel on this
> platform."
>
> Maybe I need the 3.4? Download that (which is a bit of pig getting it from
> my browser's download directory, to anywhere else on my file system). But
> same error.
>
> Maybe it's the AMD64 bit, as my processor is Intel. (But is is really that
> critical??) I try the win32 version - same error.
>
> Perhaps I'm overthinking it, maybe this will work:
>
>   pip install pygame
>
> and it will do whatever it needs to do to locate and download whatever
> version it knows is needed.

Yes, as Ned told you. Actually, this should be so blatantly obvious
that I fell into the trap of assuming you'd already tried it. Mea
culpa.

> Well, that seemed to do something, and it didn't need me to download any
> .whl files. But then I noticed a bunch of errors culminating with:
>
> "Command python setup.py egg_info failed with error code 1 in
> C:\Users\user\AppData\Local\Temp\pip_build_user\pygame"

If you've broken your pip in some way, we won't be able to help you
debug it with just this. Figure out why your Python 3.6 doesn't have a
working pip, because that IS the normal and obvious thing to do.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread bartc

On 11/01/2018 15:23, Chris Angelico wrote:

On Fri, Jan 12, 2018 at 12:38 AM, bartc  wrote:



Although I can't run it because 'pygame' is not available. I think
installing this library is likely to be a bigger obstacle than programming
any graphics!

(If I try and download it as a ready-built library for Windows, it has a
range of .msi files, none of which is a match for my Python. The newest is
for win32 Py3.2; I need win64 Py3.6. While building from source involves
running MSVC 2008  urghh)


https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame

Go. Fetch. Stop fudding.


And you know this link, how? Because googling for 'download pygame', it 
doesn't appear on the first page (or in any of the next half dozen).


But clicking on it, the most promising link seems to have 'cp36' and 
'amd64'; I assume the 36 means 3.6.


OK, but what the hell do I do with a .whl file? Google tells me I 
install it something like this: pip install file.whl.


Except my Python 3.6 doesn't have pip. There is a however a copy in my 
Python 3.4. But that gives me the message:


 "pygame-1.9.3-cp36-cp36m-win_amd64.whl is not a supported wheel on 
this platform."


Maybe I need the 3.4? Download that (which is a bit of pig getting it 
from my browser's download directory, to anywhere else on my file 
system). But same error.


Maybe it's the AMD64 bit, as my processor is Intel. (But is is really 
that critical??) I try the win32 version - same error.


Perhaps I'm overthinking it, maybe this will work:

  pip install pygame

and it will do whatever it needs to do to locate and download whatever 
version it knows is needed.


Well, that seemed to do something, and it didn't need me to download any 
.whl files. But then I noticed a bunch of errors culminating with:


"Command python setup.py egg_info failed with error code 1 in 
C:\Users\user\AppData\Local\Temp\pip_build_user\pygame"


So, yeah, it IS a palaver. Although even that wouldn't be a problem if 
it worked.


And, yeah, I will continue to say that installing libraries in Python is 
such a PITA that I usually don't bother.


Things should Just Work. Or be simple enough that you can easily find 
out why they don't.


--
bartc
--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Ned Batchelder

On 1/11/18 10:23 AM, Chris Angelico wrote:

On Fri, Jan 12, 2018 at 12:38 AM, bartc  wrote:

On 11/01/2018 05:16, Michael Torrie wrote:

On 01/10/2018 01:13 PM, bartc wrote:



Yes the link didn't have the simple examples I hoped for.  How's this:
-
import pygame
import time

pygame.init()
screen = pygame.display.set_mode((1024, 768) )
red = (255,0,0)
green = (0,255,0)

screen.fill( (255,255,255) )
pygame.draw.lines(screen, red, False, ((0,0),(100,100)))
pygame.draw.lines(screen, green, False, ((0,100),(100,0)))
pygame.display.update()

time.sleep(5)
pygame.quit()
--


That looks reasonable.

Although I can't run it because 'pygame' is not available. I think
installing this library is likely to be a bigger obstacle than programming
any graphics!

(If I try and download it as a ready-built library for Windows, it has a
range of .msi files, none of which is a match for my Python. The newest is
for win32 Py3.2; I need win64 Py3.6. While building from source involves
running MSVC 2008  urghh)

https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame

Go. Fetch. Stop fudding.


I notice that pygame also has a nice set of wheels on PyPI: 
https://pypi.python.org/pypi/Pygame/1.9.3, including for win64 Python 
3.6, so "pip install pygame" should work.  Some people seem so 
determined to dislike a thing, they cannot be convinced there are 
solutions to their problems.


--Ned.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Michael Torrie
On 01/11/2018 06:38 AM, bartc wrote:
> Although I can't run it because 'pygame' is not available. I think 
> installing this library is likely to be a bigger obstacle than 
> programming any graphics!
> 
> (If I try and download it as a ready-built library for Windows, it has a 
> range of .msi files, none of which is a match for my Python. The newest 
> is for win32 Py3.2; I need win64 Py3.6. While building from source 
> involves running MSVC 2008  urghh)

PyGame has a lot of extra stuff for programming games.  Under the hood
it uses SDL for all the primitives.  So maybe that would be preferred to
using pygame anyway.  SDL is well supported on Windows, but I don't know
about the Python SDL bindings.


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread Chris Angelico
On Fri, Jan 12, 2018 at 12:38 AM, bartc  wrote:
> On 11/01/2018 05:16, Michael Torrie wrote:
>>
>> On 01/10/2018 01:13 PM, bartc wrote:
>
>
>> Yes the link didn't have the simple examples I hoped for.  How's this:
>> -
>> import pygame
>> import time
>>
>> pygame.init()
>> screen = pygame.display.set_mode((1024, 768) )
>> red = (255,0,0)
>> green = (0,255,0)
>>
>> screen.fill( (255,255,255) )
>> pygame.draw.lines(screen, red, False, ((0,0),(100,100)))
>> pygame.draw.lines(screen, green, False, ((0,100),(100,0)))
>> pygame.display.update()
>>
>> time.sleep(5)
>> pygame.quit()
>> --
>
>
> That looks reasonable.
>
> Although I can't run it because 'pygame' is not available. I think
> installing this library is likely to be a bigger obstacle than programming
> any graphics!
>
> (If I try and download it as a ready-built library for Windows, it has a
> range of .msi files, none of which is a match for my Python. The newest is
> for win32 Py3.2; I need win64 Py3.6. While building from source involves
> running MSVC 2008  urghh)

https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame

Go. Fetch. Stop fudding.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-11 Thread bartc

On 11/01/2018 05:16, Michael Torrie wrote:

On 01/10/2018 01:13 PM, bartc wrote:



Yes the link didn't have the simple examples I hoped for.  How's this:
-
import pygame
import time

pygame.init()
screen = pygame.display.set_mode((1024, 768) )
red = (255,0,0)
green = (0,255,0)

screen.fill( (255,255,255) )
pygame.draw.lines(screen, red, False, ((0,0),(100,100)))
pygame.draw.lines(screen, green, False, ((0,100),(100,0)))
pygame.display.update()

time.sleep(5)
pygame.quit()
--


That looks reasonable.

Although I can't run it because 'pygame' is not available. I think 
installing this library is likely to be a bigger obstacle than 
programming any graphics!


(If I try and download it as a ready-built library for Windows, it has a 
range of .msi files, none of which is a match for my Python. The newest 
is for win32 Py3.2; I need win64 Py3.6. While building from source 
involves running MSVC 2008  urghh)



PyGame has other primitives like circles, ellipses, etc.  Much like the
old BASIC graphics primitives.


'Turtle' will do it (assuming there's a way of drawing things without
having to watch an actual turtle symbol crawling around the screen).


Yes I think it can.


One simple library of my own (not for Python) would use one function
call to create a window, and another to draw an element (say, a box)
within that window. (Plus a third to keep it on the screen otherwise it
will disappear when the program terminates.)


Are you thinking of sprites?


No. I've put an example of my library, roughly corresponding to what I 
believe your example does, below my sig (as it is not Python). This is 
fairly low level and expects to have another layer applied, but it is 
not too bad to use directly.


(This library actually is entirely implemented in the byte-code 
language, and talks directly to Win32 API.


That would be the equivalent of Pygame being written in 100% Python, 
which would make it trivial to install. But some elements would need to 
be different according to platform.)


--
Bartc

-
import gxlib

proc start=

w := gxcreatewindow(dim:(1024,768))

gxclear(w,getrgb(yellow))# window is already white

gxcolour(w, getrgb(red))
gxline(w, 0,0, 100,100)

gxcolour(w, getrgb(green))
gxline(w, 0,0, 100,0)

eventloop()

end
--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-10 Thread Michael Torrie
On 01/10/2018 01:13 PM, bartc wrote:
> I couldn't see anything obviously simple there. A lot seems to do with 
> interaction which is always much more complicated than just drawing stuff.

Yes the link didn't have the simple examples I hoped for.  How's this:
-
import pygame
import time

pygame.init()
screen = pygame.display.set_mode((1024, 768) )
red = (255,0,0)
green = (0,255,0)

screen.fill( (255,255,255) )
pygame.draw.lines(screen, red, False, ((0,0),(100,100)))
pygame.draw.lines(screen, green, False, ((0,100),(100,0)))
pygame.display.update()

time.sleep(5)
pygame.quit()
--

PyGame has other primitives like circles, ellipses, etc.  Much like the
old BASIC graphics primitives.

> 'Turtle' will do it (assuming there's a way of drawing things without 
> having to watch an actual turtle symbol crawling around the screen).

Yes I think it can.

> One simple library of my own (not for Python) would use one function 
> call to create a window, and another to draw an element (say, a box) 
> within that window. (Plus a third to keep it on the screen otherwise it 
> will disappear when the program terminates.)

Are you thinking of sprites?

> The only way to get it simpler than that is where the display window is 
> always present (like some old Basics).

This is sort of similar to PyGame's concepts.

-- 
https://mail.python.org/mailman/listinfo/python-list


Simple graphic library for beginners

2018-01-10 Thread Mikhail V
> > But the OP isn't looking for a full-blown GUI toolkit.  I went back and
> > re-read his post to be sure I wasn't misunderstanding.  Therefore I
> > don't think the suggestion to use wxPython or PyQt is that helpful.
> >
> > Do you have any other suggestions?
> >
> > Even Cairo is pretty complicated (requiring pens and contexts) for what
> > he's asking for.
> >
> > Personally I don't think it gets much easier or simpler than this sort
> > of thing:
> > https://github.com/Mekire/pygame-samples
>
> I couldn't see anything obviously simple there. A lot seems to do with
> interaction which is always much more complicated than just drawing stuff.
>
> 'Turtle' will do it (assuming there's a way of drawing things without
> having to watch an actual turtle symbol crawling around the screen).
>

That's right. Cairo, IIRC is mainly used as a rasterizer backend, so it
is not what OP wants.

Pygame is a SDL wrapper (a low-level lib), and NOT a wrapper for
GUI widgets. Almost everything must be made from ground up -
keyborad/mouse input, buttons (OP told about buttons).

So there not even such thing as "button" there - Pygame has nothing
of that high-level concept by default, so it will require an 3d party
module that implements those.

But, for *programming* classes, I personally would still recommend Pygame.

As for something quick and simple, Turtle seems to be good.

BTW - openCV is an excellent lib for drawing and image manipulation.
It has tons of ready-to-use functions and can show things up in a
window without additional coding.
But again: if you want *buttons*, then you are merely speaking about
a framework, not a lib. IOW if you drop the beloved by
people "buttons" idea, then you have much more good options.

PyQT is probably overkill, but it has a tool for GUI construction (qtdesigner)
and it makes it child-easy to draw a window with buttons, and some
canvas object, and then auto-creates pieces of code with objects and
interaction slots. So PyQT is imo better option for noobs than Pygame.
So here you have buttons and lots of OOP bloat as a consequence.



Mikhail
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-10 Thread bartc

On 10/01/2018 17:36, Michael Torrie wrote:

On 01/10/2018 10:22 AM, Igor Korot wrote:

  Hi,
wxPython/Phoenix.
It can do everything you need and more


But the OP isn't looking for a full-blown GUI toolkit.  I went back and
re-read his post to be sure I wasn't misunderstanding.  Therefore I
don't think the suggestion to use wxPython or PyQt is that helpful.

Do you have any other suggestions?

Even Cairo is pretty complicated (requiring pens and contexts) for what
he's asking for.

Personally I don't think it gets much easier or simpler than this sort
of thing:
https://github.com/Mekire/pygame-samples


I couldn't see anything obviously simple there. A lot seems to do with 
interaction which is always much more complicated than just drawing stuff.


'Turtle' will do it (assuming there's a way of drawing things without 
having to watch an actual turtle symbol crawling around the screen).



One simple library of my own (not for Python) would use one function 
call to create a window, and another to draw an element (say, a box) 
within that window. (Plus a third to keep it on the screen otherwise it 
will disappear when the program terminates.)


The only way to get it simpler than that is where the display window is 
always present (like some old Basics).



--
bartc
--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-10 Thread Igor Korot
 Hi, Michael,

On Wed, Jan 10, 2018 at 11:36 AM, Michael Torrie  wrote:
> On 01/10/2018 10:22 AM, Igor Korot wrote:
>>  Hi,
>> wxPython/Phoenix.
>> It can do everything you need and more
>
> But the OP isn't looking for a full-blown GUI toolkit.  I went back and
> re-read his post to be sure I wasn't misunderstanding.  Therefore I
> don't think the suggestion to use wxPython or PyQt is that helpful.

Completely agree.
However people started throwing PyQt for some unknown reason, so I had to
respond. ;-)

Thank you.

>
> Do you have any other suggestions?
>
> Even Cairo is pretty complicated (requiring pens and contexts) for what
> he's asking for.
>
> Personally I don't think it gets much easier or simpler than this sort
> of thing:
> https://github.com/Mekire/pygame-samples
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-10 Thread Arthur Endlein Correia
Yes, considering the OP request, pygame would be better, or one of Mark's
suggestions:
mcsp.wartburg.edu/zelle/python/graphics.py
Seems really easy to use.



---
Arthur Endlein Correia
arthur.corr...@usp.br
endart...@gmail.com
55 11 968 606 174
IGc, USP

On Wed, Jan 10, 2018 at 3:36 PM, Michael Torrie  wrote:

> On 01/10/2018 10:22 AM, Igor Korot wrote:
> >  Hi,
> > wxPython/Phoenix.
> > It can do everything you need and more
>
> But the OP isn't looking for a full-blown GUI toolkit.  I went back and
> re-read his post to be sure I wasn't misunderstanding.  Therefore I
> don't think the suggestion to use wxPython or PyQt is that helpful.
>
> Do you have any other suggestions?
>
> Even Cairo is pretty complicated (requiring pens and contexts) for what
> he's asking for.
>
> Personally I don't think it gets much easier or simpler than this sort
> of thing:
> https://github.com/Mekire/pygame-samples
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-10 Thread Michael Torrie
On 01/10/2018 10:22 AM, Igor Korot wrote:
>  Hi,
> wxPython/Phoenix.
> It can do everything you need and more

But the OP isn't looking for a full-blown GUI toolkit.  I went back and
re-read his post to be sure I wasn't misunderstanding.  Therefore I
don't think the suggestion to use wxPython or PyQt is that helpful.

Do you have any other suggestions?

Even Cairo is pretty complicated (requiring pens and contexts) for what
he's asking for.

Personally I don't think it gets much easier or simpler than this sort
of thing:
https://github.com/Mekire/pygame-samples
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-10 Thread Igor Korot
 Hi,
wxPython/Phoenix.
It can do everything you need and more


And it will look exactly as any other application on the system...

Thank you.


On Wed, Jan 10, 2018 at 11:04 AM, Michael Torrie <torr...@gmail.com> wrote:
> On 01/10/2018 09:16 AM, oliver wrote:
>> Pyqt without hesitation.
>
> Except that people are forgetting the OP is not asking about a GUI
> library. The subject line reads "Simple graphic[s] library for
> beginners."  He just wants a simple graphics drawing library for
> beginners.  Create a canvas of a certain size, draw lines, circles, and
> other primitives to it.
>
> PyQt can do all these things, but it's overkill for what the OP requires.
>
> Personally I recommend he look at PyGame, or SDL with PySDL2.  Both of
> these libraries are designed to do what the OP is asking.  I recently
> needed to do some very simple line drawing to visualize a GPS path, and
> I found PyGame worked rather well, and was nearly as simple as the old
> QuickBasic graphics routines.
>
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-10 Thread Michael Torrie
On 01/10/2018 09:16 AM, oliver wrote:
> Pyqt without hesitation.

Except that people are forgetting the OP is not asking about a GUI
library. The subject line reads "Simple graphic[s] library for
beginners."  He just wants a simple graphics drawing library for
beginners.  Create a canvas of a certain size, draw lines, circles, and
other primitives to it.

PyQt can do all these things, but it's overkill for what the OP requires.

Personally I recommend he look at PyGame, or SDL with PySDL2.  Both of
these libraries are designed to do what the OP is asking.  I recently
needed to do some very simple line drawing to visualize a GPS path, and
I found PyGame worked rather well, and was nearly as simple as the old
QuickBasic graphics routines.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-10 Thread oliver
Pyqt without hesitation.

   - I've used it in full-fledged desktop app (120k LOC) and it's just
   awesome, so well documented, versatile, and you can learn gradually
   (starting with their simpler tablewidget then later move to their
   tableview/model for added flexibility).
   - Qt is moving so fast into iot and automotive and is so popular on
   desktops, that it's a skill that gets noticed on resumes or in interviews
   (i'm talking from first hand experience).
   - It is available in multiple languages like Java, Go and C#, although I
   have not used those wrappers (the PyQt wrapper is based on sip, whereas
   these other ones are not, so I have no idea about stability etc).
   - the community is huge, there are powerful tools like pytest.qt plugin
   for unit testing GUI, pycharm IDE integrates with it.
   - there is dual license based on LGPL and commercial, with reasonable
   costs, perfect for learning/startup then eventually (if that's the goal
   medium or long term) distribute/sell.

Oliver

On Wed, 10 Jan 2018 at 10:46 bartc  wrote:

> On 10/01/2018 14:55, Antoon Pardon wrote:
> > On 10-01-18 13:40, Jan Erik Moström wrote:
> >> I'm looking for a really easy to use graphic library. The target users
> >> are teachers who have never programmed before and is taking a first
> >> (and possible last) programming course.
> >>
> >> I would like to have the ability to draw lines, circles, etc. Nothing
> >> fancy, as little window management as possible (possible buttons),
> >> perhaps simple events like button presses or clicks on canvas - think:
> >> making simple diagrams or simple figures. Cross-platform
> >>
> >>
> >> Yes, I know about tkinter.
> >>
> >> Yes, I know about various block languages like Scratch but they are
> >> not relevant in this case.
> >>
> >> Any suggestions?
> >>
> >> = jem
> >
> > cairo?
>
> Isn't that output only? (And not necessarily to a screen, but to an
> image or PDF for example.)
>
> So that no interaction is possible.
>
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
Oliver
My StackOverflow contributions
My CodeProject articles
My Github projects
My SourceForget.net projects
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-10 Thread bartc

On 10/01/2018 14:55, Antoon Pardon wrote:

On 10-01-18 13:40, Jan Erik Moström wrote:

I'm looking for a really easy to use graphic library. The target users
are teachers who have never programmed before and is taking a first
(and possible last) programming course.

I would like to have the ability to draw lines, circles, etc. Nothing
fancy, as little window management as possible (possible buttons),
perhaps simple events like button presses or clicks on canvas - think:
making simple diagrams or simple figures. Cross-platform


Yes, I know about tkinter.

Yes, I know about various block languages like Scratch but they are
not relevant in this case.

Any suggestions?

= jem


cairo?


Isn't that output only? (And not necessarily to a screen, but to an 
image or PDF for example.)


So that no interaction is possible.



--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-10 Thread Antoon Pardon
On 10-01-18 13:40, Jan Erik Moström wrote:
> I'm looking for a really easy to use graphic library. The target users
> are teachers who have never programmed before and is taking a first
> (and possible last) programming course.
>
> I would like to have the ability to draw lines, circles, etc. Nothing
> fancy, as little window management as possible (possible buttons),
> perhaps simple events like button presses or clicks on canvas - think:
> making simple diagrams or simple figures. Cross-platform
>
>
> Yes, I know about tkinter.
>
> Yes, I know about various block languages like Scratch but they are
> not relevant in this case.
>
> Any suggestions?
>
> = jem

cairo?

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-10 Thread Arthur Endlein Correia
Tkinter can look nice and not terribly hard to use, as I found out in this
tutorial:
http://www.tkdocs.com/tutorial/onepage.html
Having said that, nowadays I pretty much always use PyQt (or Pyside)
together with qtdesigner to build GUI applications.




---
Arthur Endlein Correia
arthur.corr...@usp.br
endart...@gmail.com
55 11 968 606 174
IGc, USP

On Wed, Jan 10, 2018 at 12:08 PM,  wrote:

> On Wednesday, January 10, 2018 at 12:42:07 PM UTC, Jan Erik Moström wrote:
> > I'm looking for a really easy to use graphic library. The target users
> > are teachers who have never programmed before and is taking a first (and
> > possible last) programming course.
> >
> > I would like to have the ability to draw lines, circles, etc. Nothing
> > fancy, as little window management as possible (possible buttons),
> > perhaps simple events like button presses or clicks on canvas - think:
> > making simple diagrams or simple figures. Cross-platform
> >
> >
> > Yes, I know about tkinter.
> >
> > Yes, I know about various block languages like Scratch but they are not
> > relevant in this case.
> >
> > Any suggestions?
> >
> > = jem
>
> Take a look at https://python-sfml.org/, https://www.ogre3d.org/about or
> mcsp.wartburg.edu/zelle/python/graphics.py
>
> --
> Kindest regards.
>
> Mark Lawrence.
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-10 Thread breamoreboy
On Wednesday, January 10, 2018 at 12:42:07 PM UTC, Jan Erik Moström wrote:
> I'm looking for a really easy to use graphic library. The target users 
> are teachers who have never programmed before and is taking a first (and 
> possible last) programming course.
> 
> I would like to have the ability to draw lines, circles, etc. Nothing 
> fancy, as little window management as possible (possible buttons), 
> perhaps simple events like button presses or clicks on canvas - think: 
> making simple diagrams or simple figures. Cross-platform
> 
> 
> Yes, I know about tkinter.
> 
> Yes, I know about various block languages like Scratch but they are not 
> relevant in this case.
> 
> Any suggestions?
> 
> = jem

Take a look at https://python-sfml.org/, https://www.ogre3d.org/about or 
mcsp.wartburg.edu/zelle/python/graphics.py

--
Kindest regards.

Mark Lawrence.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-10 Thread Thomas Jollans
On 2018-01-10 13:40, Jan Erik Moström wrote:
> I'm looking for a really easy to use graphic library. The target users
> are teachers who have never programmed before and is taking a first (and
> possible last) programming course.
> 
> I would like to have the ability to draw lines, circles, etc. Nothing
> fancy, as little window management as possible (possible buttons),
> perhaps simple events like button presses or clicks on canvas - think:
> making simple diagrams or simple figures. Cross-platform
> 
> 
> Yes, I know about tkinter.
> 
> Yes, I know about various block languages like Scratch but they are not
> relevant in this case.
> 
> Any suggestions?

It depends on what you're planning to do; "simple graphics library" and
"making [...] figures" are two requirements that don't necessarily fit
together perfectly.

Perhaps turtle (https://docs.python.org/3/library/turtle.html) would
suit your needs?

If that's not what you're looking for, just pick any popular library
that does the specific things you want to use in your lesson, and teach
only the relevant bits. If you want (scientific) graphs and figures, go
matplotlib. It's not the nicest library, but it's powerful and
well-represented on stack overflow. If you want buttons and stuff, go
for PyQt or Tkinter. Both are messy and complicated, and Tkinter looks
terrible by default, but that's just the way it is.


-- Thomas
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-10 Thread Larry Martell
On Wed, Jan 10, 2018 at 7:42 AM Jan Erik Moström 
wrote:

> I'm looking for a really easy to use graphic library. The target users
> are teachers who have never programmed before and is taking a first (and
> possible last) programming course.
>
> I would like to have the ability to draw lines, circles, etc. Nothing
> fancy, as little window management as possible (possible buttons),
> perhaps simple events like button presses or clicks on canvas - think:
> making simple diagrams or simple figures. Cross-platform
>
>
> Yes, I know about tkinter.
>
> Yes, I know about various block languages like Scratch but they are not
> relevant in this case.
>
> Any suggestions?
>

I really like plotly.

>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Simple graphic library for beginners

2018-01-10 Thread Jan Erik Moström
I'm looking for a really easy to use graphic library. The target users 
are teachers who have never programmed before and is taking a first (and 
possible last) programming course.


I would like to have the ability to draw lines, circles, etc. Nothing 
fancy, as little window management as possible (possible buttons), 
perhaps simple events like button presses or clicks on canvas - think: 
making simple diagrams or simple figures. Cross-platform



Yes, I know about tkinter.

Yes, I know about various block languages like Scratch but they are not 
relevant in this case.


Any suggestions?

= jem
--
https://mail.python.org/mailman/listinfo/python-list