Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #106561

Re: Promoting Python

From Gregory Ewing <greg.ewing@canterbury.ac.nz>
Newsgroups comp.lang.python
Subject Re: Promoting Python
Date 2016-04-06 20:52 +1200
Message-ID <dmk137Ftl1iU1@mid.individual.net> (permalink)
References <DUB110-DS131649FA6F6AA56BBDD63E989E0@phx.gbl> <mailman.54.1459840979.32530.python-list@python.org>

Show all headers | View raw


Another option for graphical stuff is pygame:

http://pygame.org/news.html

A rough translation of some of your code:

import pygame, sys
from pygame import display, draw, event, font, Color, QUIT

# Set up the display window
screen = display.set_mode((800, 600))

colors = ["red", "orange", "yellow", "green", "blue", "purple"]

font.init()
f = font.Font(None, 24)
y = 10
for name in colors:
     text = f.render("Color " + name, True, Color(name))
     screen.blit(text, (10, y))
     y += text.get_height()

x = 30
y = 200
for name in colors:
     c = Color(name)
     draw.circle(screen, c, (x, y), 20)
     x += 50

# Refresh the screen
display.flip()

# Pause until the window is closed
while True:
     for e in event.get():
         if e.type == QUIT:
             sys.exit(0)

-- 
Greg

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Promoting Python "Gordon( Hotmail )" <sionet3344@hotmail.co.uk> - 2016-04-05 06:48 +0100
  Re: Promoting Python Rustom Mody <rustompmody@gmail.com> - 2016-04-05 00:31 -0700
    Re: Promoting Python Joel Goldstick <joel.goldstick@gmail.com> - 2016-04-05 08:06 -0400
      Re: Promoting Python alister <alister.ware@ntlworld.com> - 2016-04-05 18:02 +0000
        Re: Promoting Python BartC <bc@freeuk.com> - 2016-04-05 19:47 +0100
          Re: Promoting Python alister <alister.ware@ntlworld.com> - 2016-04-05 19:38 +0000
    Re: Promoting Python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-04-05 08:13 -0400
      Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-05 15:31 +0300
  Re: Promoting Python Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-04-06 20:52 +1200
    Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 12:12 +0300
  Re: Promoting Python BartC <bc@freeuk.com> - 2016-04-06 12:06 +0100
    Re: Promoting Python Ned Batchelder <ned@nedbatchelder.com> - 2016-04-06 04:38 -0700
      Re: Promoting Python BartC <bc@freeuk.com> - 2016-04-06 14:21 +0100
    Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 14:46 +0300
      Re: Promoting Python Michael Selik <michael.selik@gmail.com> - 2016-04-06 13:33 +0000
        Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 17:14 +0300
          Re: Promoting Python Chris Angelico <rosuav@gmail.com> - 2016-04-07 00:20 +1000
            Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 21:23 +0300
              Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 21:50 +0300
              Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 22:30 +0300
          Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 22:22 +0300
            Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 22:59 +0300
              Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 23:39 +0300
                Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-07 01:03 +0300
                Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-07 09:30 +0300
                Re: Promoting Python Ian Kelly <ian.g.kelly@gmail.com> - 2016-04-07 00:56 -0600
                Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-07 10:19 +0300
                Re: Promoting Python Steven D'Aprano <steve@pearwood.info> - 2016-04-08 16:09 +1000
          Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 23:05 +0300
      Re: Promoting Python BartC <bc@freeuk.com> - 2016-04-06 14:54 +0100
        Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 17:08 +0300
          Re: Promoting Python Larry Martell <larry.martell@gmail.com> - 2016-04-06 10:36 -0400
        Re: Promoting Python Chris Angelico <rosuav@gmail.com> - 2016-04-07 00:14 +1000
        Re: Promoting Python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-04-06 15:20 +0100
          Re: Promoting Python Ned Batchelder <ned@nedbatchelder.com> - 2016-04-06 07:34 -0700
            Re: Promoting Python Ned Batchelder <ned@nedbatchelder.com> - 2016-04-06 10:55 -0700
              Re: Promoting Python BartC <bc@freeuk.com> - 2016-04-06 23:24 +0100
          Re: Promoting Python BartC <bc@freeuk.com> - 2016-04-06 18:04 +0100
    Re: Promoting Python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-04-06 08:04 -0400
    Re: Promoting Python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-04-06 13:39 +0100
    Re: Promoting Python Steven D'Aprano <steve@pearwood.info> - 2016-04-07 03:40 +1000

csiph-web