Hello

2 views
Skip to first unread message

David R.

unread,
Apr 13, 2010, 5:42:49 PM4/13/10
to pyw...@googlegroups.com
Hi, I'm David.  I'm a student of Jeff's, and I'll be working on PyKata for the rest of the year at least - probably a lot longer, I'm a freshman this year and will be here for a while.  I spent the last quarter learning App Engine in a general sense - wrote a guessing game (http://1.latest.ellimistdr.appspot.com/index.html).  It's got most of the basics of app engine stuff, with the glaring exception of anything using the datastore itself, rather than the memcache - I still need to learn that. 

Anyway, I've checked out the read-only code in the svn, and I understand it for the most part.  It doesn't use the format I'm used to, but I get it.  My big confusion with it is how you get from the main.py program to the main application in pykata/views.py?  There are no links that I can see.  Anyway, I need something to do while I get used to the code and so on, so if you have any simple bugs I could try to fix, show me and I'll take a go at them. 

Thanks,
 --David Reich

Jeff Elkner

unread,
Apr 13, 2010, 5:49:19 PM4/13/10
to pyw...@googlegroups.com
I have two students ready and eager to contribute to pyKata, and would
be most grateful if they could be introduced to the project by being
assigned some low hanging bug or small feature to implement. From
whom could such a task be given?

Thanks!

jeff elkner

Abhishek Mishra

unread,
Apr 14, 2010, 3:08:13 AM4/14/10
to PyWhip
Hi David,

Seems like we both are in the same boat (PyKata development) :)
You should checkout http://code.google.com/p/pykata/source/browse/trunk/pykata/urls.py
That is were we define url to functions in the views.py
Right now PyKata is based on djago+app engine, and in a way django
does the url to controller magic
as seen in main.py -
# Run the WSGI CGI handler with that application.
util.run_wsgi_app(application)

Whereas when we write a normal appengine app, most of the times we
already have the url mappings in say index.py itself just below the
class that extends webapp framework.

These days people recommend to use http://bitbucket.org/wkornewald/djangoappengine/
which is under active development, while what we use right now dates
back to April 2008.

There have been discussions on porting it to web2py, if we're able to
do that then it would be really easy for anyone to join in and start
contribute in minutes. This would also help us attract new developers
to PyKata in future as the friction between getting familiar and
committing their first patch would be reduced greatly :D

Hope that helps you proceed.

regards,
Abhishek

David MacQuigg

unread,
Apr 14, 2010, 8:52:02 AM4/14/10
to Jeff Elkner, pyw...@googlegroups.com
Hello Jeff,

Google has a developer's kit (SDK) that your students can download and
run a local app engine server on their own desktop. This will allow
them to experiment with our code base without actually uploading changes
to the public server. If they get something that looks good, they can
submit it for integration into our running code base. From what little
testing I've done, this seems to work very well, even on things I didn't
expect, like uploading to the datastore. I've also kept the old PyWhip
site alive, in case we need to experiment with an actual public server.

Our issues tracker has some current problems to work on, but don't let
that limit your imagination. Your students will probably have some good
ideas on things we haven't thought of. You might also have them work
on creating some more content, putting some of the problems from your
book into proper format for upload, and generally debugging the whole
process that authors will go through in contributing content to PyKata.
Even if we end up with a different format later, we will be able to
translate current exercises into the new format using the
download/upload scripts we are now working on. That is one advantage of
having our own scripts for this purpose.

If you don't have a copy of "Programming Google App Engine" by Dan
Sanderson, I highly recommend getting one for your students. It reads
well, and is more thorough than the online documentation. It even has
a chapter on Django (although we may be switching soon to Web2py).

-- Dave

David MacQuigg

unread,
Apr 16, 2010, 12:23:07 PM4/16/10
to PyWhip
It is quite likely we will get two students this summer. We need to
think about how to organize the work so they don't get in each others
way.

Rather than have two students pursue alternative proposals for
implementing the website, we could have one work primarily on building
up our content in time for the fall semester. That work can expand or
contract, leaving time to help with tasks that can be split off from
the main line of development, or to try ideas that the second student
might want to pursue in a branch off the main repository.

One content project I have thought about is translating the AP Java
exam to Python. We had an [edu-sig] discussion a while back on how
costly it would be to have an alternative AP exam. This project would
show the contrary. It could also generate some interesting
statistics. Teachers who use Python could administer the exam under
conditions very similar to a regular College Board exam. Then we can
compare student scores - Python vs Java.

Of course having all these previous exam problems available for
practice on PyKata might give the Python students and "unfair"
advantage, but the purpose of the comparison is not to prove anything,
just raise a few questions.

--
You received this message because you are subscribed to the Google Groups "PyWhip" group.
To post to this group, send email to pyw...@googlegroups.com.
To unsubscribe from this group, send email to pywhip+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pywhip?hl=en.

Andre Roberge

unread,
Apr 16, 2010, 12:51:00 PM4/16/10
to pyw...@googlegroups.com
On Fri, Apr 16, 2010 at 12:23 PM, David MacQuigg <macq...@box67.com> wrote:
It is quite likely we will get two students this summer. We need to
think about how to organize the work so they don't get in each others
way.

I don't want to sound too negative, but ...

The preliminary ranking is just that: a preliminary ranking.  

PyKata had basically one project for students.  Imo, it would be inappropriate at this stage to consider artificially creating new projects that have very little in common with actual students proposal.  (more below)

 
Rather than have two students pursue alternative proposals for
implementing the website, we could have one work primarily on building
up our content in time for the fall semester.

Building up content is NOT a coding activity.  I mentioned this before on this list I believe: the "C" in GSoC stands for Code; the student is expected to upload the code he or she produced to a repository.

While I totally agree that creating such content as you suggest would be a most worthwhile activity, I don't believe it would respect the spirit of GSoC.

Of course, I am not the one who decides.  I'd suggest you contact an administrator before pursuing this further.

André

David MacQuigg

unread,
Apr 16, 2010, 2:22:03 PM4/16/10
to PyWhip
Hi Andre,

Your critique is appreciated.

> The preliminary ranking is just that: a preliminary ranking.

I'm not looking at the preliminary ranking, but the allocation of 30
slots to PSF, and only 65 proposals under review, most of them
inferior to ours. On the other hand, we are new to PSF, and they may
give us only one slot to see how we do on our first time in GSoC. As
I understand it, PSF is starting with a proportional allocation of
slots to proposals, then adjusting up or down based on their own
assessment of the project's value to Python and probability of
success.

> > Rather than have two students pursue alternative proposals for
> > implementing the website, we could have one work primarily on building
> > up our content in time for the fall semester.
>
> Building up content is NOT a coding activity.  I mentioned this before on
> this list I believe: the "C" in GSoC stands for Code; the student is
> expected to upload the code he or she produced to a repository.

My suggestion was not just generating any old content, but translating
the AP Java exam to Python, a project that could have enormous value
to the Python community. Translating Java to Python *is* coding, and
it takes a fair amount of skill in both languages, or the result will
be just some Python exercises that attempt to solve problems the way
they are solved in Java. What we need are shining examples of how to
do it right in Python.

A student taking on this project will not need the superb web-
development skills of our lead developer, but will need to exercise
good judgement in finding the essence of what the Java problem is
testing, and providing an equivalent in Python. Take a look at the
Grid World example. Doing something equivalent in Python will be a
big challenge.

> While I totally agree that creating such content as you suggest would be a
> most worthwhile activity, I don't believe it would respect the spirit of
> GSoC.
>
> Of course, I am not the one who decides.  I'd suggest you contact an
> administrator before pursuing this further.

The only thing we should do now is be ready when the decisions are
made. Then if a change in plans is beneficial, we'll seek whatever
approvals are needed. Considering the traffic on the mentors list,
now is not the time to bother the administrators.

Richard Guenther

unread,
Apr 19, 2010, 6:53:08 PM4/19/10
to pyw...@googlegroups.com
On Fri, Apr 16, 2010 at 10:51 AM, Andre Roberge <andre....@gmail.com> wrote:
Building up content is NOT a coding activity.  I mentioned this before on this list I believe: the "C" in GSoC stands for Code; the student is expected to upload the code he or she produced to a repository.

While I totally agree that creating such content as you suggest would be a most worthwhile activity, I don't believe it would respect the spirit of GSoC.

I agree here, and I think my school can help with this.  We tend to take on a lot of projects, but this one could be a major focus for some of my students, and developing content would be a welcome break from all the coding we do trying to make things work in Java, Greenfoot, Python, Pygame, Processing, etc....

We recently got a new computer lab.  In the process of unpacking, I came across a folder of PyBat problems that my students and I had worked on a while back--but had not posted.  I think what we need to do is sit down together (several students and I) and go through the process of posting problems.  We can do that this week during our programming club (Thursday), but I could also involve one of my two Python sections on this. 

Also, I think I can get a student or two to at least experiment with writing gridworld in pygame or even Zelle's graphics module, if we want to start looking into that issue.  It's interesting to see how they incorporated Gridworld into Greenfoot, as an example:

http://www.greenfoot.org/ap/

Thanks!

Richard 

 

Richard Guenther
Math and Computer Science
Skyline High School
Longmont, CO

David MacQuigg

unread,
Apr 19, 2010, 9:19:13 PM4/19/10
to pyw...@googlegroups.com
Hi Richard,

Richard Guenther wrote:
> developing content would be a welcome break from all the coding we do
> trying to make things work in Java, Greenfoot, Python, Pygame,
> Processing, etc....

Excellent!! Put the problems in
http://code.google.com/p/pykata/wiki/UploadFormat, and we will be able
to upload them to a future version of PyKata also.

We have an "upload" button at the top of the form where you would
normally add new problems by cut-and-paste. I may need to hide this to
avoid vandalism, but I'll send you the link if I do.

> We recently got a new computer lab. In the process of unpacking, I
> came across a folder of PyBat problems that my students and I had
> worked on a while back--but had not posted.

If these are translations of JavaBat problems, we need to be careful.
Nick Parlante has generously allow us to use a few of his problems, but
he doesn't want wholesale copying.

> Also, I think I can get a student or two to at least experiment with
> writing gridworld in pygame or even Zelle's graphics module, if we
> want to start looking into that issue. It's interesting to see how
> they incorporated Gridworld into Greenfoot, as an example:

If you can do it with Zelle's graphics module, that will make the whole
thing very transparent, and easy for students to look "under the hood".
On the other hand, if you need high-speed, high-resolution graphics,
pygame is excellent. I used it to generate my Mandelbrot images.

I've offered to mentor a Google Summer of Code project to improve IDLE
as a programming environment for students. Sure would be nice if we
didn't have to install extra packages just to get some nice and easy
graphics. Plotting a simple function should be no more difficult than
pressing the GRAPH button on a calculator. I'll have to recruit you as
a co-mentor if the project is accepted.

-- Dave

Richard Guenther

unread,
Apr 22, 2010, 10:53:11 PM4/22/10
to pyw...@googlegroups.com
On Mon, Apr 19, 2010 at 7:19 PM, David MacQuigg <macq...@box67.com> wrote:
Excellent!!  Put the problems in http://code.google.com/p/pykata/wiki/UploadFormat, and we will be able to upload them to a future version of PyKata also.

Will do!
 

If these are translations of JavaBat problems, we need to be careful.  Nick Parlante has generously allow us to use a few of his problems, but he doesn't want wholesale copying.


They are not JavaBat problems.  In fact, at the time we were looking at JavaBat and thinking "...no way, can you imagine how much of a no-brainer that would be in Python."  Then, when we saw that Nick was just copying the JavaBat problems over to the Python section we went through them and realized that they really were simple. 
 

If you can do it with Zelle's graphics module, that will make the whole thing very transparent, and easy for students to look "under the hood".  On the other hand, if you need high-speed, high-resolution graphics, pygame is excellent.  I used it to generate my Mandelbrot images.


I'll look into this.  The case study, of course, goes much beyond the "tactical" exercises that JavaBat helped with.  The case study was all about interfaces and inheritance.  It will be fun to see how Python's "made for consenting programmers" approach will work here.... 

Thanks!
Richard


--

Richard Guenther
Math and Computer Science
Skyline High School
Longmont, CO

Andrew Harrington

unread,
Apr 23, 2010, 12:23:56 AM4/23/10
to pyw...@googlegroups.com
It occurs to me that we do need another provision in problems:  files to import that are not in the standard distribution.  For instance, the Algebra II/Python class I am teaching now in a local HS involves developing a Rational class, used in linear functions and polynomials, and the polynomials and Rationals are used in the rational functions.  In an organized lesson/exercise sequence, I want to be able to use earlier modules from my curriculum.

Though it got me thinking about extra pachkages, I do not understand the reference to Zelle's graphics (which I use every semester) in relation to pyKata.  Zelles graphics runs in local applications via TKinter.  In Crunchy they went to great lengths to develop a simple graphics package that works through Javascript, I believe, in the browser.

Andy
--
Andrew N. Harrington
 Director of Academic Programs
 Computer Science Department
 Loyola University Chicago
 512B Lewis Towers (office)
 Snail mail to Lewis Towers 416
 820 North Michigan Avenue
 Chicago, Illinois 60611

http://www.cs.luc.edu/~anh
Phone: 312-915-7982
Fax:    312-915-7998
g...@cs.luc.edu for graduate administration
u...@cs.luc.edu for undergrad administration
aha...@luc.edu as professor

Andre Roberge

unread,
Apr 23, 2010, 6:16:17 AM4/23/10
to pyw...@googlegroups.com
On Fri, Apr 23, 2010 at 1:23 AM, Andrew Harrington <anharr...@gmail.com> wrote:
It occurs to me that we do need another provision in problems:  files to import that are not in the standard distribution.  For instance, the Algebra II/Python class I am teaching now in a local HS involves developing a Rational class, used in linear functions and polynomials, and the polynomials and Rationals are used in the rational functions.  In an organized lesson/exercise sequence, I want to be able to use earlier modules from my curriculum.

Though it got me thinking about extra pachkages, I do not understand the reference to Zelle's graphics (which I use every semester) in relation to pyKata.  Zelles graphics runs in local applications via TKinter.  In Crunchy they went to great lengths to develop a simple graphics package that works through Javascript, I believe, in the browser.


Actually, I wouldn't call what did "going to great lengths", but yes, we (I mostly) wrote a simple graphics package that works through Javascript.  It is slow and could easily be improved. 

In single user mode (i.e. you run Crunchy on your machine), you can run local applications via Tkinter and have windows pop up on your computer.  In server mode (i.e. Crunchy is running on another computer), you can't do this as the windows would pop up on the server - hence the need for a javascript-based client-based graphics solution, and hence the above comment by Andrew. :-)

André

 

Richard Guenther

unread,
Apr 26, 2010, 12:33:45 PM4/26/10
to pyw...@googlegroups.com
I wasn't sure if we wanted something like Gridworld up and running on the site, or rather the ability to just include Gridworld problems on the site--which could possibly just fit in like all the other problems (ie, they don't actually do anything except return the normal run-time feedback).  I was thinking the latter.

Since then, however, I have been looking closer at Gridworld and wondering what approach one would take to make a Gridworld in Python.  I think that's a discussion all it's own, as the "Pythonic" way certainly would not be the Java way of handling the OOP design.  :-/

I was thinking of a Gridworld version in Zelle's module only because it is commonly used as a first graphics module in Python courses.  I wasn't thinking of it running on the website.  I'd like to hear what others think about the Gridworld in Python issue.

Thanks!

Richard

On Thu, Apr 22, 2010 at 10:23 PM, Andrew Harrington <anharr...@gmail.com> wrote:
...I do not understand the reference to Zelle's graphics (which I use every semester) in relation to pyKata.  Zelles graphics runs in local applications via TKinter. ...

David MacQuigg

unread,
Apr 26, 2010, 2:32:18 PM4/26/10
to PyWhip
The challenge is to replicate the essence of Gridworld in Python so we
have something directly comparable to the same problem in Java. Most
of the simplification will come from Python's simpler syntax, simpler
classes, and simpler ways of doing the exact equivalent of what is
done in Java.

Things get a little trickier when you start changing the design of the
problem from the "Java way" to a "Pythonic way". The criticism will
be - Sure your students can solve this problem twice as fast. You
made the problem twice as easy!

Then you have to make arguments like - we really don't need to define
a class here. All we are doing is printing "Hello world". That's a
simple and obvious example, but you can imagine the arguments in a
more complex case. The defenders of Java will say you are over-
simplifying, and losing important fundamental parts of the problem.
We know that's not true, but it will be hard to prove.

So I would stick with the original design, even if it is overly
complex, unless the complexity favors Java, i.e. a problem designed
around the idiosyncrasies of some Java class.

We don't have any current plans to add graphics to the output of
PyKata problems. That would be difficult to score as Pass/Fail. My
suggestion to replicate Gridworld was independent of PyKata - just
something to provide a demo of Python that Java teachers will pay
attention to - a statistic saying showing, for example, that if the AP
exam were written in Python, students would solve it in half the time,
with 10% better scores.

Richard Guenther

unread,
Apr 26, 2010, 11:26:01 PM4/26/10
to pyw...@googlegroups.com
Good.  I agree with your reasoning on GW.  I'll start working on this with a student of mine.

I guess one thing we'd need to decide up front is how to deal with method and attribute access.  Do we use a single underscore, a double underscore or just a regular method heading on methods that are private in GW?

def get_dance_moves() 
# open to teh world...

def _get_dance_moves()
#minor inconvenience just to say, "hope you know what you're doing with this..."

or ...

def __get_dance_moves() 
#you'll have to do some name mangling to call this method outside this class....

That may seem like a minor detail in Python, but a student in APCS needs to know when to use public and private (default and protected are not used in APCS), and quite a bit of class time is spent discussing those issues. :-/

Richard


On Mon, Apr 26, 2010 at 12:32 PM, David MacQuigg <macq...@box67.com> wrote:
The challenge is to replicate the essence of Gridworld in Python so we
have something directly comparable to the same problem in Java.  Most
of the simplification will come from Python's simpler syntax, simpler
classes, and simpler ways of doing the exact equivalent of what is
done in Java.

Things get a little trickier when you start changing the design of the
problem from the "Java way" to a "Pythonic way". 

Richard Guenther
Math and Computer Science
Skyline High School
Longmont, CO

David MacQuigg

unread,
Apr 27, 2010, 7:04:05 AM4/27/10
to PyWhip
I would stick with the simple convention that a single leading
_underscore means private, and not get into any half-baked attempts to
enforce privacy. I'm assuming that will be sufficient to replicate
the functionality of Gridworld, but I'm not that familiar with it. If
someone says, we are missing something essential, I would say - if you
really need enforced privacy, use Java. Python is for consenting
adults. :>)

The only situation I've been in where enforcement was necessary, was
my last job at Cadence. Our circuit design tools had 4000 public
functions, and tens of thousands of private functions. Customers
would use the private functions anyway, then when their programs broke
on some later release, we would get pressure through our marketing
department to fix their programs. That kind of "industrial"
programming is pretty far from my current interests, and pretty far
from the fundamentals we ought to be teaching in high school.

Richard Guenther

unread,
Apr 27, 2010, 11:17:27 PM4/27/10
to pyw...@googlegroups.com
On Tue, Apr 27, 2010 at 5:04 AM, David MacQuigg <macq...@box67.com> wrote:
I would stick with the simple convention that a single leading
_underscore means private, and not get into any half-baked attempts to
enforce privacy.

Agreed!  Thanks.


Richard Guenther
Math and Computer Science
Skyline High School
Longmont, CO

Reply all
Reply to author
Forward
0 new messages