Simple graphic library for beginners

Ned Batchelder ned at nedbatchelder.com
Thu Jan 11 11:26:06 EST 2018


On 1/11/18 10:23 AM, Chris Angelico wrote:
> On Fri, Jan 12, 2018 at 12:38 AM, bartc <bc at freeuk.com> 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.



More information about the Python-list mailing list