Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Homework help requested (not what you think!)

199 views
Skip to first unread message

John Ladasky

unread,
Jul 16, 2013, 6:43:45 PM7/16/13
to
Hi folks,

No, I'm not asking for YOU to help ME with a Python homework assignment!

Previously, I mentioned that I was starting to teach my son Python.

https://groups.google.com/d/msg/comp.lang.python/I7spp6iC3tw/8lxUXfrL-9gJ

He just took a course at his high school called Web Technology and Design. They had the students use tools like Dream Weaver, but they also hand-coded some HTML and JavaScript. He has a little experience. I am building on it.

Well, a few other parents caught wind of what I was doing with my son, and they asked me whether I could tutor their kids, too. I accepted the jobs (for pay, actually).

The kids all claim to be interested. They all want to write the next great 3D video game. Thus, I'm a little surprised that the kids don't actually try to sit down and code without me prompting them. I think that they're disappointed when I show them how much they have to understand just to write a program that plays Tic Tac Toe.

Where programming is concerned, I'm an autodidact. I started programming when I was twelve, with little more guidance than the Applesoft Basic manual and the occasional issue of Byte Magazine. I hacked away. Over the years, I have acquired a working knowledge of BASIC, 6502 assembly language, Pascal, C, and finally Python (my favorite). If I knew how to impart a love of experimentation to my students, I would do that.

One kid looks like he's ready to forge ahead. In the mean time, one parent has recognized his son's lack of independence, and has asked me to assign programming homework. I hope it doesn't kill the kid's enthusiasm, but I'm willing to try it.

So, what I am seeking are suggestions for programming assignments that I can give to brand-new students of Python. Please keep in mind that none of them are even up to the task of a simple algorithm like Bubble Sort -- at least, not yet.

Many thanks!

David Hutto

unread,
Jul 16, 2013, 7:51:40 PM7/16/13
to John Ladasky, python-list
You have to utilize a set curriculum to teach. Look at several books like Dive Into Python, and such, then work with the student on an individualized project for each one. For 3D you go with pygame and trig, or go with Blender's python API
 or matplotlib. Just at first show the basic types of data, that is what I'd suggest, like mutable immutable, lists tuples, and dictionaries to get the hang of data containment that will probably move on to database management, and loopiing/iterating through data, or updating a GUI.  Further teaching is moving on to what the student is trying to accomplish.

HTH


Joel Goldstick

unread,
Jul 16, 2013, 8:53:57 PM7/16/13
to Chris Angelico, pytho...@python.org



On Tue, Jul 16, 2013 at 8:40 PM, Chris Angelico <ros...@gmail.com> wrote:
On Wed, Jul 17, 2013 at 8:43 AM, John Ladasky
<john_l...@sbcglobal.net> wrote:
> I think that they're disappointed when I show them how much they have to understand just to write a program that plays Tic Tac Toe.


The disillusionment of every novice programmer, I think. It starts out
as "I want to learn programming and make a game". Real programming is
more like "I can automate mundane tasks", which doesn't sound half as
exciting. But this is why I'm dubious of programming courses that
actually try to hold onto the "let's make a game" concept, because the
students are likely to get a bit of a let-down on realizing that it
really doesn't work that easily ("this is a two-week course, at the
end of it I should have written the next <insert name of popular game>
for all my friends").

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

There is a book : http://inventwithpython.com/  Invent Your Own Computer Games with Python
which claims to teach people to program games in python.  I haven't read it, but it seems to be for beginning programmers.  Take a look.. Maybe it would work for your kids.  It says its for kids younger than high school, but it claims to be for all ages.  It does cover the turf your gang seems most interested in.  Other positives -- its free online.  so no investment.  And it introduces the concept of open source which is really a key to a large segment of the whole software world, so that gives another teaching moment

--

Chris Angelico

unread,
Jul 16, 2013, 8:40:31 PM7/16/13
to pytho...@python.org
On Wed, Jul 17, 2013 at 8:43 AM, John Ladasky
<john_l...@sbcglobal.net> wrote:
> I think that they're disappointed when I show them how much they have to understand just to write a program that plays Tic Tac Toe.


Chris Angelico

unread,
Jul 16, 2013, 9:34:36 PM7/16/13
to pytho...@python.org
On Wed, Jul 17, 2013 at 10:53 AM, Joel Goldstick
<joel.go...@gmail.com> wrote:
> There is a book : http://inventwithpython.com/ Invent Your Own Computer
> Games with Python
> which claims to teach people to program games in python. I haven't read it,
> but it seems to be for beginning programmers. Take a look.. Maybe it would
> work for your kids.

Not my siblings specifically, but I've seen this happen elsewhere quite a bit.

Thing is, they still won't be making the next Call of Duty Black Ops,
or Alice: Madness Returns, or even the next Angry Birds. It's like
looking at the roads and how car manufacturers produce things that run
from here to Sydney, and then learning how to build a go-kart with
wooden wheels - strong disappointment in the scale of achievement.
Which is a pity, because that go-kart can be a lot of fun; the novice
programmer has to get past that disappointment and discover the other
fun aspects of coding, like the ability to improve your own
environment. (At work, one of my most useful oddments of code is a log
tailing system that runs on each of N remote servers and effectively
runs "tail -F foo.log" for each of M log files, tags the lines with
the hostname and log file name, and sends it to a single display on my
computer. Makes my job easier to the extent that I probably paid off
the time investment within a week, but it's hardly glamorous stuff.)

ChrisA

alex23

unread,
Jul 17, 2013, 2:35:19 AM7/17/13
to
On 17/07/2013 8:43 AM, John Ladasky wrote:
> The kids all claim to be interested. They all want to write the next great 3D video game. Thus, I'm a little surprised that the kids don't actually try to sit down and code without me prompting them. I think that they're disappointed when I show them how much they have to understand just to write a program that plays Tic Tac Toe.

One possible approach would be to pick existing games developed in
PyGame and assist them to modify or extend them. This can be a lot less
overwhelming than starting a game from scratch, and exposes them to the
basic concepts such as the main event loop, separating out logic from
display etc. Code reading is as valuable a skill as code writing.

Another possibility is using a more extensive framework like Unity,
which provides a lot of the toolchain to simplify the development
process. While Unity doesn't support Python by default, it does provide
Boo, which is Python-inspired. It's also built on top of the Mono
framework, and I believe people have had some success with using .NET's
IronPython with it.

Steven D'Aprano

unread,
Jul 17, 2013, 2:51:12 AM7/17/13
to
On Tue, 16 Jul 2013 15:43:45 -0700, John Ladasky wrote:

> The kids all claim to be interested. They all want to write the next
> great 3D video game. Thus, I'm a little surprised that the kids don't
> actually try to sit down and code without me prompting them. I think
> that they're disappointed when I show them how much they have to
> understand just to write a program that plays Tic Tac Toe.

I morn the death of Hypercard :(

http://www.loper-os.org/?p=568

Using Hypercard was like using Lego. You could literally copy and paste
buttons from one app to another -- not code, the actual GUI button -- to
copy their functionality.


You could try Pythoncard:

http://pythoncard.sourceforge.net/


> So, what I am seeking are suggestions for programming assignments that I
> can give to brand-new students of Python. Please keep in mind that none
> of them are even up to the task of a simple algorithm like Bubble Sort
> -- at least, not yet.

Alas, I don't think there is *any* system for GUI programming that comes
even close to what is needed to keep the majority of new students
interested. But you might have some success with text-based games. Here
are two suggestions:

- guess the number


- twenty questions ("is it bigger than a breadbox?")




You might also like to investigate Inform-7.

http://inform7.com/


--
Steven

Joshua Landau

unread,
Jul 17, 2013, 4:33:26 AM7/17/13
to John Ladasky, python-list
On 16 July 2013 23:43, John Ladasky <john_l...@sbcglobal.net> wrote:
>
> Well, a few other parents caught wind of what I was doing with my son, and they asked me whether I could tutor their kids, too. I accepted the jobs (for pay, actually).
>
> The kids all claim to be interested. They all want to write the next great 3D video game. Thus, I'm a little surprised that the kids don't actually try to sit down and code without me prompting them. I think that they're disappointed when I show them how much they have to understand just to write a program that plays Tic Tac Toe.
>
> Where programming is concerned, I'm an autodidact. I started programming when I was twelve, with little more guidance than the Applesoft Basic manual and the occasional issue of Byte Magazine. I hacked away. Over the years, I have acquired a working knowledge of BASIC, 6502 assembly language, Pascal, C, and finally Python (my favorite). If I knew how to impart a love of experimentation to my students, I would do that.
>
> One kid looks like he's ready to forge ahead. In the mean time, one parent has recognized his son's lack of independence, and has asked me to assign programming homework. I hope it doesn't kill the kid's enthusiasm, but I'm willing to try it.
>
> So, what I am seeking are suggestions for programming assignments that I can give to brand-new students of Python. Please keep in mind that none of them are even up to the task of a simple algorithm like Bubble Sort -- at least, not yet.


As probably the youngest regular on this list (still not a kid any
more though, as much as I would like to be) it's always been my
experience that if you see someone young who says "I'm really
interested in how to program!" they already either know a little (or a
lot) or they're probably somewhat deluded. Programming's so easy to
learn solo that if they haven't at least tried, they're just not as
interested as they say ;).

For homework I actually recommend reading assignments. Something that
gets you straight there. When I taught a few people (back not that
long ago to A-level [UK], once-a week lunchtime things) the first
thing everyone went through were these:

https://groups.google.com/forum/#!category-topic/learn-how-to-program---matthew-arnold/help-for-lesson-1/cKy43xj56y4
https://groups.google.com/forum/#!category-topic/learn-how-to-program---matthew-arnold/help-for-lesson-2/iR6pMtsgFjA

Note that I rather quickly stopped using the forum above, as with
https://sites.google.com/site/learnhowtoprogram/, which I only really
used to host code we needed (I got too lazy to update the rest,
basically), so there's nothing else woth checking. I give you 100%
free permission to steal anything of mine from those links, though.

I'm no teaching expert, but these seemed to help people get the idea.
The basic concept is that before you learn to write, you learn to
read. If you give them well-documented (like, every line is
documentation¹) code or something like the duo of links I posted above
it will probably be a lot more meaningful than asking them to do
something trivial they already know.

I hear from a lot of people over teh netz that they learnt how to code
from reading OSS. I personally didn't do most of my learning that way,
but it doesn't mean that it doesn't work. The person from my lessons
who learnt the most was the guy who of his own choice took some of the
code we were working on and changed it at home without prompting to do
something else. At the beginning there was no way he could write code
that was marginally useful, and thus doing so would have been
massively boring and discouraging -- giving him a platform he could
work on made it much easier to do something useful.


I hope I inspired a few thoughts, I'm not giving you the One True Way
but these ideas should at least be blocks you can build with.

¹ See https://sites.google.com/site/learnhowtoprogram/Snake.py (which
might have a purposeful bug in there, it's been a small while since I last
ran it). That was for almost-new coders, with the aim of giving them
something they originally could read but not really understand, and by
gradually editing the code together they ended up getting it.

PythonAB

unread,
Jul 17, 2013, 4:31:37 AM7/17/13
to pytho...@python.org
another vote for Unity here...
We teach that at the filmschool here in Holland and it's a
really well supported package.
There's a free version and it "exports" to Windows, OSX,
Linux, Playstation, XBOX, iPhone etc etc
But that comes at the cost already mentioned by Alex above...
http://en.wikipedia.org/wiki/Unity_(game_engine)
http://unity3d.com/

One step more advanced, but only available on Windows, is
the CryEngine:
http://en.wikipedia.org/wiki/Cryengine
http://mycryengine.com/
They also have a free version but again, no Python scripting
by default.


Another one to bring into attention may be Panda3D:
http://www.panda3d.org/
That has full Python support.

Don't forget that all these engines require you to build your
assets yourself, outside the engine.
This means that you have to go into a 3D program like Blender
to create characters, environments and creatures.

greets
Arno Beekman

Neil Cerutti

unread,
Jul 17, 2013, 9:20:11 AM7/17/13
to
On 2013-07-16, John Ladasky <john_l...@sbcglobal.net> wrote:
> So, what I am seeking are suggestions for programming
> assignments that I can give to brand-new students of Python.
> Please keep in mind that none of them are even up to the task
> of a simple algorithm like Bubble Sort -- at least, not yet.

One of the first satisfying programs I wrote as a child
autodidact on my Commodore 64 was a random name generator. There
are lots of workable strategies and the output can be fun.

Hint: Putting together random syllables turned out to be much
more fun than random consonants and vowels.

Markov chains are an advanced technique you could introduce, but
you'd need a huge list of names broken into syllables from
somewhere.

--
Neil Cerutti

Chris Angelico

unread,
Jul 17, 2013, 9:29:56 AM7/17/13
to pytho...@python.org
On Wed, Jul 17, 2013 at 11:20 PM, Neil Cerutti <ne...@norwich.edu> wrote:
> Markov chains are an advanced technique you could introduce, but
> you'd need a huge list of names broken into syllables from
> somewhere.

You could use names broken into letters... or skip the notion of names
and just generate words. Lists of words are easy to come by (eg
/usr/share/dict/words on many Linux systems), so you can have some fun
without much effort.

ChrisA

Neil Cerutti

unread,
Jul 17, 2013, 9:55:06 AM7/17/13
to
That's true. Something like syllables should emerge from markov
chains of letters pretty well, depending on how long the the
chain is.

--
Neil Cerutti

Chris Angelico

unread,
Jul 17, 2013, 10:05:38 AM7/17/13
to pytho...@python.org
I might have to hunt down my old Dissociated Press implementations,
they were fun fun fun.

ChrisA

alex23

unread,
Jul 17, 2013, 10:09:07 PM7/17/13
to
I really wanted Dihedral to chime in here.

Aseem Bansal

unread,
Jul 18, 2013, 12:57:42 AM7/18/13
to
You can use PySide/QtCreator for getting a skeleton UI as easily as in case of Visual Studio. Converting it into .py files is also quite easy. Experiment a little for yourself in the beginning and you'll be able to make a simple Tic-Tac-Toe easily.

You can then decide how complex that becomes. Remember that computer's behaviour just might be the most complex thing in this whole thing. You can then take that out, explain the students that the game will work if you can make a function for this, explain the logic and that can be a really nice homework assignment.

I think that would be much better than just jumping off to a game engine sidetracking Python completely.

If you want to introduce them to programming in general in a fun way http://scratch.mit.edu/ might be much easier for making simple 2D games. It isn't Python but it is even better introduction to programming than Python(I am saying this even when I use Python everyday and I like it). Scratch isn't for long term but initially this could be their dose of excitement and introduction to the basics of programming. That would give you time to make simple games in PySide for taking them to Python gradually without killing their excitement.

Beth McNany

unread,
Jul 17, 2013, 6:03:06 PM7/17/13
to John Ladasky, pytho...@python.org
On Tue, Jul 16, 2013 at 6:43 PM, John Ladasky <john_l...@sbcglobal.net> wrote:

Thanks for this!  I'm trying to put together something very similar right now for my younger brother, and this thread and associated links have been very helpful.  He's taught himself enough Python to make a rudimentary text adventure game already, so the interest is definitely there.  I'm hoping to sneak in some general CS concepts as well, although I'm concerned some things might be less obvious in Python.  Also, I learned to program in PHP and Java before I learned Python (starting with a Django project), so I'm not sure how to start there... probably going to borrow some ideas from the intro level Java class I've been TA'ing.

In my experience, people learn best via projects, so I've been trying to come up with some that are interesting, not too difficult, and focus on one or two main concepts.  To be honest, I have no idea how realistic they are, because it's been a while since I first learned how to program and that wasn't even in Python.  Offering it up here for your perusal / feedback (roughly in the order I'd do them):

- text adventure: practice with stdlib, control flow, I/O. Lots of opportunities for embellishment here - create maps of rooms, load/save games by serializing into files or even a database, create status bars in the console, etc.

- blackjack:  a game with simple rules, you have to think about representation for the cards, and you can easily simulate a computer opponent.  extra credit: graphical front-end that displays images for the cards.

- sudoku checker/generator/solver: practice with lists, loops, logic, implementing algorithms.  extra credit: design a solver yourself without looking up algorithms.

- mandelbrot set app: math and graphics! can use this as an opportunity to introduce numpy/matplotlib, or DIY.  (could be a bit esoteric depending on the student, though.)

- game of life: simple graphics and update rules, fun to watch, source of the unofficial hacker emblem.

- (extra credit?) simple chat program: this doesn't really fit the theme, but it's an introduction to networking / sockets, which could be useful. (and the intro class had lots of fun sending messages back and forth in class.)

At this point, I'm hoping he'll be comfortable enough to begin working on a more complete game (most likely, using pygame, as he hasn't expressed much interest in 3D).  Some ideas for classic/simple/well-defined games to try:
- blob game (what is this one actually called? where the player absorbs smaller entities to grow but dies if he runs into a bigger entity)
- tank battle (again, not sure on the name. two players, moving around, shooting at each other on a map with obstructions)
- maze (bonus points for a maze generation algorithm)
- snake
- frogger
- asteroids
- etc.

This doesn't include a lot of standard but less flashy stuff e.g. advanced data structures, graphs, sorting algorithms, because the idea was to find projects that would be tractable for someone just starting out and wanting to make fun things... but once they're hooked, you can explain how they're useful and start into those (at least, that's my theory).  But you could still talk about things like classes, OO design, exception handling, recursion, complexity (especially with the sudoku project), as related to these projects.

(As a side note, I'm a bit amused by the discussions about teaching "kids" specifically.  When I was 17 I was a freshman enrolled in a Data Structures course, where I discovered that a course I took two years prior had already covered about 90% of the material...)

-beth

Albert van der Horst

unread,
Jul 18, 2013, 8:47:42 AM7/18/13
to
In article <mailman.4786.1374021...@python.org>,
Now comes the Forth experience.

I did the following experiment with a psychology student, who had
never been exposed to computers and had no prior experience. He
aquired a Jupiter Ace, which has Forth as a built in language. So his
only exposure was to Forth. Now I started to teach him programming,
using the cartoon book "starting Forth". Once in a weeek we sat
together and worked through some exercises.

After 6 weeks he surprised me. He had programmed the game pong
which is a simple table tennis like game, where you have to
keep a ball in play.
He never gave me a a chance to prevent him having a traumatic experience
of failure by telling him that was not a task a novice should start.
Or for that matter that such any real time programming requires considerable
up front planning and design.
[This was an adult, and at the time university students in the
Netherlands were certified intelligent and skilled and disciplined
in learning.]

The lesson that is in there for you is to not hold your students back.
They may surprise you!

Groetjes Albert






>
>ChrisA
--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

Gene Heskett

unread,
Jul 18, 2013, 9:38:15 AM7/18/13
to pytho...@python.org
On Thursday 18 July 2013 09:04:32 Albert van der Horst did opine:
I'll 2nd those thoughts, and tell 2 or 3 stories.

When the Timex 1000 was new, I bought one for my kids and turned them loose
with it. Within a week my 10 year old had composed a car graphic, and
written a small program to drive it around on the screen.

Back in a slightly newer time frame, Mr. Brodie's Forth, where you built
your own extensions to the language, was used for a time at a small CA
hospital as the hospitals accounting system, on a machine with only 64k of
dram. A TRS-80 Color Computer we now call the old grey ghost.

Fast forward 5 years from then, I wrote a program to work with a Grass
Valley Group 300-3A/B television video switcher, which you could teach to
do tricks, but it didn't have a means to save and reload them without
buying a $20,000 EDISK accessory package.

So I wrote one in Basic09, running on a Color Computer 2, still only 64k of
dram, based on a copy of the com protocol that had come with the switcher
when we had purchased it used from KTLA-TV. I wrote it on station time,
and sold the station the hardware at about what it was worth at the time
for a coco2 and 2 disk drives, $275. 14 years later as I was getting ready
to retire and no one else knew that switcher, it was replaced, and my 'E-
DISK' was no longer needed, so they gave it to me, so I still have it in my
'coco' collection in the basement.

Moral of course is never tell somebody it can't be done, he'll eat your
lunch by doing it. Oh, BTW, mine was 4x faster, and instead of a 2 hex
digit display for file names, gave the tech directors English filenames on
a small video screen. They loved it because each one could then have his
own personalized bag of video tricks to use during a news cast.

> >ChrisA


Cheers, Gene
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene> is up!
My views
<http://www.armchairpatriot.com/What%20Has%20America%20Become.shtml>
Syntactic sugar causes cancer of the semicolon.
-- Epigrams in Programming, ACM SIGPLAN Sept. 1982
A pen in the hand of this president is far more
dangerous than 200 million guns in the hands of
law-abiding citizens.

Joseph Clark

unread,
Jul 18, 2013, 11:46:15 AM7/18/13
to John Ladasky, pytho...@python.org
Not to open Pandora's box or anything, but are you aware of the Roguelike community (subculture?) (cult?) of game development? Rogue was an old "text-based" role playing game for Unix, "text-based" in the sense that it used the console as a 2D map and ASCII characters as graphics. There has been a sort of revival of the genre and a lot of amateur game developers have done some simple or complex variations on the theme. They're not all RPGs. The category is defined by a few commonalities like procedural content generation.

There are very active forums and an extensive wiki. I think these might be particularly appropriate fodder for a tutoring experience because they are neatly broken down into bite-sized chunks. One day you could do procedural map generation, another day AI, etc. And all these lessons generalize to the "professional" game development world.

Look at this forum: http://forums.roguetemple.com/index.php?board=7.0
This wiki: http://roguebasin.roguelikedevelopment.org/index.php?title=Main_Page
This Python tutorial: http://roguebasin.roguelikedevelopment.org/index.php?title=Complete_Roguelike_Tutorial,_using_python%2Blibtcod

By the way, I tried my hand at Markov chain name generation, too. My python code is at https://github.com/joeclark77net/jc77rogue/blob/master/program/namegen.py
and what it does is read a corpus of names and generate new names that sound like that corpus. So you feed it a list of Roman names and it will give you fake names that sound Roman.

// joseph w. clark , phd , visiting research associate
\\ university of nebraska at omaha - college of IS&T
----------------------------------------
> Date: Tue, 16 Jul 2013 15:43:45 -0700
> Subject: Homework help requested (not what you think!)
> From: john_l...@sbcglobal.net
> To: pytho...@python.org
> --
> http://mail.python.org/mailman/listinfo/python-list

John Ladasky

unread,
Jul 21, 2013, 4:49:40 PM7/21/13
to
Thanks to everyone for their wealth of suggestions. I already had my students playing with turtle. And I had asked them to alphabetize a string (without having previously revealed the sorted() function).

So far, I have taken up the suggestion of the number-guessing game. One of my students has a working version. The logic is a bit clumsy, but it's a fine first attempt.

I will also take up the Twenty Questions idea. My son and I played that game a lot over the years, to pass the time on long car rides. And it would be a great way to introduce the binary tree data structure.

Another project I thought of was a Pig Latin translator. (But do kids today even know what Pig Latin is? Am I showing my age?)

Concerning more advanced, real-time, game-oriented graphics, I am trying to figure out how to build PyGame on top of Python3.x. Supposedly it is possible. I just haven't figured out how. It's 2013: I refuse to complicate my students' programming education with Python 2.x.

I used wxPython happily for years, and I think that its graphical capabilities would probably be up to the task of a simple 2D game. Unfortunately, it has the same problem as PyGame, at least for now. The Py3-compatible version of wxPython, to be known as Phoenix, is still under development.

I'll keep Unity, Panda3D, and Blender in mind for later. Again, one of my main concerns will be Python 3.x compatibility.

Chris Angelico

unread,
Jul 21, 2013, 8:25:14 PM7/21/13
to pytho...@python.org
On Mon, Jul 22, 2013 at 6:49 AM, John Ladasky
<john_l...@sbcglobal.net> wrote:
> Another project I thought of was a Pig Latin translator. (But do kids today even know what Pig Latin is? Am I showing my age?)


Even if they don't, they'll grok it no problem. It's simple enough.

ChrisA

Roy Smith

unread,
Jul 21, 2013, 8:57:45 PM7/21/13
to
In article <mailman.4968.1374452...@python.org>,
Igpay ythonpay!

Joseph Clark

unread,
Jul 21, 2013, 11:10:50 PM7/21/13
to John Ladasky, pytho...@python.org
John, have you taken a look at pyglet?  It's an alternative to pygame and I found it pretty slick once I got the hang of it.  There is a development version that's compatible with python 3 and I've never had a bug with it.  It wraps OpenGL itself so there are no additional dependencies.




// joseph w. clark , phd , visiting research associate
\\ university of nebraska at omaha - college of IS&T
 
> Date: Sun, 21 Jul 2013 13:49:40 -0700
> Subject: Homework help requested, thanks to everyone.
> From: john_l...@sbcglobal.net
> To: pytho...@python.org

Skip Montanaro

unread,
Jul 22, 2013, 1:01:49 PM7/22/13
to Python
John> Another project I thought of was a Pig Latin translator. (But
do kids today
John> even know what Pig Latin is? Am I showing my age?)

Chris> Even if they don't, they'll grok it no problem. It's simple enough.

Google for "Python pig latin" to see a lot of "prior art".

And it might be useful as a step as part of a word-based password generator. :-)

>>> words = open("/usr/dict/words")
>>> words = [word.strip() for word in words if len(word) == 5]
>>> len(words)
2194
>>> import random
>>> random.shuffle(words)
>>> words[0:4]
['live', 'skat', 'levy', 'cove']
>>> [makePigLatin(word) for word in words[0:4]]
['ivelay', 'atskay', 'evylay', 'ovecay']

:-)

Skip
Message has been deleted

John Ladasky

unread,
Jul 23, 2013, 2:24:52 AM7/23/13
to
On 07/21/2013 08:10 PM, Joseph Clark wrote:
> John, have you taken a look at pyglet? It's an alternative to pygame and I found it pretty slick once I got the hang of it. There is a development version that's compatible with python 3 and I've never had a bug with it. It wraps OpenGL itself so there are no additional dependencies.
>
>
> // joseph w. clark , phd , visiting research associate
> \\ university of nebraska at omaha - college of IS&T
>
Hi Joe,

Thanks for the PyGLet recommendation. I like OpenGL. Unfortunately, I can't seem to get PyGLet to work, even though the pyglet.org front page claims that "the major 1.2alpha1 release brings pyglet to Python 3."

I followed the links to this page:

https://code.google.com/p/pyglet/downloads/list?q=1.2alpha1

I installed pyglet on my Linux system's Python 3.3 using distutils, as I have done with many other packages. But I can't run test.py, nor can I even get as far as importing pyglet from my Python 3.3 interpreter command line. The obstacle is apparently Python 2.x-style print statements, which are found throughout tests.py and pyglet/__init__.py.

Does anyone know an efficient way around this problem? Thanks!

Devyn Collier Johnson

unread,
Jul 25, 2013, 9:35:47 AM7/25/13
to Python Mailing List
I cannot get Pyglet to work. I successfully installed the module and it
imports successfully, but a previously suggested command does not work.
I use Python3.

>>> import pyglet
>>> pyglet.media.load('./boot.ogg', streaming=False).play()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'media'

Mahalo,

DCJ

John Ladasky

unread,
Jul 25, 2013, 6:27:48 PM7/25/13
to
Hi Devyn. After I didn't get a response concerning PyGLet inside this thread, I started another thread. It's here:

https://groups.google.com/forum/#!topic/comp.lang.python/ARtI0GC9RHc
0 new messages