er any method invocation a "function call", I consider the constructor
invocation to be a function call.
I concede your technical point, but I stand by my (and other authors') decision
on how to treat this.
Cheers,
--John
John Zelle, PhD
Professor of Computer Science
Wartburg College
___
We've had good luck in the past using pypar (http://code.google.com/p/pypar/)
in a college scientific computing class for students who have had a single
programming course in Python. At that time (2 years ago), it seemed to be the
simplest entry point for Python-based MPI type programs.
John
that as an excuse to make
single-threaded code hard to reason about as well.
--John
John Zelle, PhD
Professor of Computer Science
Wartburg College
From: da...@handysoftware.com [da...@handysoftware.com]
Sent: Sunday, April 22, 2012 5:06 PM
To: John Zelle
read is a standard part of a sentinel loop, and both examples are shorter than
the versions that retest or assign a conditional inside the loop.
John Zelle, PhD
Professor of Computer Science
Wartburg College
From: edu-sig-bounces+john.zelle=wartburg
Oops, I think I have an off by one error in my last example. I would change the
conditional at the bottom to:
if guess == secret:
print(You guessed it!)
else:
print(You maxed out.)
That's clearer anyway.
John Zelle, PhD
Professor of Computer Science
Wartburg College
to
accomplish. Together not C and INV should be sufficient to convince yourself
(and others reading your code) that your loop has accomplished exactly what you
wanted it to.
--John
John Zelle, PhD
Professor of Computer Science
Wartburg College
From: edu-sig-bounces
.
Cheers,
--John
John Zelle, PhD
Professor of Computer Science
Wartburg College
From: edu-sig-bounces+john.zelle=wartburg@python.org
[edu-sig-bounces+john.zelle=wartburg@python.org] on behalf of Andrew
Harrington [ahar...@luc.edu]
Sent: Wednesday, December
compatibility), and I consider the API now to be at
the limit of what I can expect my CS1 students to reasonably master.
John Zelle, PhD
Professor of Computer Science
Wartburg College
From: anharring...@gmail.com [anharring...@gmail.com] on behalf of Andrew
Hi,
I agree that the behavior of booleans in Python can sometimes lead to subtle
errors, but I think it's important to stress to students that writing things
like:
if xy == True:
is _really_ bad style. After pointing that out, I start taking points away for
doing this. Code like this shows
Hello,
Isn't the issue here simply that globals does not return a copy of the globals
dictionary, it returns THE actual globals dictionary. It's not some sort of
callable, it is the globals dictionary, period. There is no such thing as a
static dictionary, they are mutable, and this one
Hi,
On Sunday 19 April 2009 18:44:30 michel paul wrote:
On Sun, Apr 19, 2009 at 2:48 PM, Gregor Lingl gregor.li...@aon.at wrote:
How do you explain the nature of range to beginners?
How about using list(range())? Something like:
# Here's how you can create a list of integers:
Hi Kirby,
I happen to be working through some Python3.0 issues right now. A couple
comments:
On Monday 16 March 2009 10:42:24 kirby urner wrote:
So then it occurs to me, would there by a way to do a kind of special
names overloading such that __next__ (that which triggers the next
cycling
Barry Schwartz's book, The Cost of Living: How Market Freedom Erodes the
Best Things in Life, has a chapter titled The Debasing of Education:
Turning Play into Work that summarizes various evidence and makes a
similar argument along these lines.
On Sat, 2008-07-26 at 10:11 -0500, Daniel Ajoy
Hi David,
I gave a detailed description of my definitions in a post a while back.
In that, I referred to the traditional view of a variable as a named
location. As per your request:
In call-by-value the formal parameter is a local variable whose content
is initialized with a copy of the value of
Hi John,
I can't agree with this.
On Tue, 2008-05-20 at 10:50 -0400, John Posner wrote:
... and stop trying to invent new names for a parameter passing mechanism
that is identical in function to traditional call by value.
Yeah, but ... it will be difficult to stick to a call-by-value
a serious
misunderstanding of what I am saying.
At 06:36 PM 5/19/2008 -0500, John Zelle wrote:
You insist on writing/thinking/reasoning as if Python variables
contain the objects they refer to, but that simply is not the case for
the traditional use of the term variable
Hi Warren,
Some interesting thoughts. You have given me something of a new insight.
(So call this a post on a related topic :-)
On Tue, 2008-05-20 at 18:35 -0700, Warren Sande wrote:
I would argue that from a functional point of view (black box, the
way it behaves), Python does behave like
.
I'll pause once more to see if I've made any mistakes, before the third and
final step - deciding what to call this thing that Python does in passing an
argument.
-- Dave
At 12:41 PM 5/15/2008 -0700, David MacQuigg wrote:
At 04:30 PM 5/14/2008 -0500, John Zelle wrote:
At some point, I
At some point, I have to just let this go, as I think we all on this
list have a pretty good understanding of the differences between C and
Python in terms of assignment and parameter passing. But let's _not_ use
the term pass by reference when talking about Python. You CANNOT
CHANGE THE CONTENTS
David,
Actually, I don't think there is that much confusion among the folks who
understand/design/study programming languages. Python uses call by
value, period, as that term is technically used. But your note below
shows the continued confusion (among programmers) about what parameter
passing
This is a very interesting assignment, but I would just point out that this is
hardly an intro CS course. They are doing these particular projects in an
intermediate/advanced data structures/algorithms class. That would be a 3rd
semester college-level course for those who entered without a
PROTECTED]
To: John Zelle [EMAIL PROTECTED]
I remember installing a patch when I couldn't get IDLE to restart on my
Windows computer. Here's a discussion of said patch:
http://mail.python.org/pipermail/patches/2006-July/020360.html
- Original Message
From: John Zelle [EMAIL PROTECTED
On Thursday 16 August 2007 8:01 am, Andy Judkis wrote:
When teaching Python to beginners and using IDLE, it seems that one of
the dangers would be to have them assigning variables in the interactive
mode and then maybe using them in a script they're writing. Then, when
they run
the
On Monday 13 August 2007 11:30 pm, kirby urner wrote:
On 8/13/07, John Zelle [EMAIL PROTECTED] wrote:
I would quibble about self not doing any work (you need it to access its
attributes), but I understand the point you are making. Again, though
this makes things seem a bit more mysterious
On Monday 13 August 2007 3:43 pm, kirby urner wrote:
Python is remarkably liberal in its design, in that 'self' is not a
keyword. You're free to use other names for this important
place in memory.
Yet there's still self-imposed discipline (another way of saying
'self discipline'), such that
Hi All,
I am very interested in responses to Andy's question because it was just this
sort of frustration with students' inability to write simple programs that
led me to using Python (as opposed to C++ or Java) in CS1. After my switch to
Python and back to basics CS1 back in 1999, my results
I agree with Kirby that madlibs are a fun example.
On Friday 06 July 2007 2:12 pm, kirby urner wrote:
As I mention in my slides for EuroPython (looking forward to
meeting Laura again tomorrow), Madlibs proved appealing
to most students, little stories where they have to prompt
.
A clue, then: it's not the transitive importing that causes the
problem, it's the importing of a file that calls GraphWin().
Peter Drake
Assistant Professor of Computer Science
Lewis Clark College
http://www.lclark.edu/~drake/
On Feb 9, 2007, at 1:09 PM, John Zelle wrote:
Peter,
I
Peter,
I should have caught this when you posted your file. There is a bizarre import
interaction that I am aware of, but can't say that I fully understand
regarding my graphics library. It seems that Python imports are in some-way,
somewhat atomic, and with the way my graphics library is set
On Wednesday 07 February 2007 10:54 am, Peter Drake wrote:
Your philosophy may differ, but I'd like to see control structures
explained sooner. You currently don't introduce if for 200 pages. I
find that it's hard to come up with interesting assignments without
if. (My idea of interesting
Hi Peter,
Just a quick question for you. I am wondering if you have checked out the
simple graphics package that I built on top of Tkinter for doing these sorts
of simple manipulations. It's also name graphics.py. If you haven't seen it,
you can check it out at:
On Friday 17 November 2006 8:07 am, Ernesto Costa wrote:
Hi,
Returning to the question of a good module about graphics. I'm
using Zohn Zelle's book for my course. It has a interesting and
simple to use graphics module. It would be nice if that module could
be merged with xturtle i.e to
On Monday 30 October 2006 10:49 am, Arthur wrote:
[EMAIL PROTECTED] wrote:
I've not used .any or .all, but having just taught my CS1 students about
boolean operators, I was reminded that Python works as the following
example describes:
x = a and b
# if both a and b are true, x is
Jason,
I've looked into Blender a number of times, and while I would like to learn
it, I have never had time for the learning curve. VPython is something my
students and I can use immediately to solve problems at hand. If my goal were
to become a 3D artist, then something like Blender would be
On Monday 09 October 2006 3:59 pm, Dethe Elza wrote:
On 9-Oct-06, at 11:15 AM, Arthur Siegel wrote:
My other hope for VPython would be to build it on a more capable 3D
system, such as Ogre or Panda3D (Mike Fletcher keeps a large list of
such systems: http://www.vrplumber.com/py3d.py). In
On Monday 09 October 2006 6:56 pm, Arthur Siegel wrote:
On Mon, 2006-10-09 at 18:41 -0500, John Zelle wrote:
Just curious, is PyOpenGL easy to install for both Mac and Windows? I
know it's dead simple on most Linux distributions. I think it's pretty
easy for Windows, but have no experience
On Saturday 16 September 2006 9:35 am, Arthur wrote:
John Zelle wrote:
no, No, NO. I never said this. At least I didn't intend to. Please see the
top of the message where I ask (virtually beg) for clarification on what
you are saying. I thought you were saying that it's OK to teach
A new twist on this thread: discussing the very nature of intro courses.
Should we read more code and program less, should our programs build to
something and not be a bunch of random scripts?
I think it's obvious to everyone that a course that tackles real world
problems will be more
On Wednesday 13 September 2006 10:22 am, Arthur wrote:
John Zelle wrote:
I think it's obvious to everyone that a course that tackles real world
problems will be more interesting than one that doesn't. But that doesn't
mean simple scripts can't address real world issues.
But there is a basic
On Friday 08 September 2006 4:27 pm, kirby urner wrote:
On 9/8/06, kirby urner [EMAIL PROTECTED] wrote:
You're not making a monkey out of your mom, by making her loop through
some little menu, oblivious of the language underneath, its logic and
design. You're protecting you mother (aka
On Saturday 09 September 2006 12:35 pm, you wrote:
snip
But mostly I'm advocating going to the other extreme: drop GUI as a
topic and just code up a namespace, reach into the grab bag for
functions, like f(x) or cos(x). We pretend kids don't have the
background, but if they did *any* work
First up, I support the petition/ suggestion whatever you want to call it.
I'm somewhat disappointed that our discussion here seems to have gotten
derailed by Arthur's comments that it's all about ease of teaching. I think I
put forward a number or solid arguments about IO being core to
On Wednesday 06 September 2006 8:00 am, Arthur Siegel wrote:
Being dispassionate on the issue itself - I have *never* used
raw_input() and, as it happens, I am generally literate enough at this
point so that the intentions of sys.stdin.readline is *clearer* to me
than is raw_input() - I am
On Monday 04 September 2006 11:03 pm, Toby Donaldson wrote:
I don't care about input. Its there now and hasn't ever been useful
to me (eval(raw_input(...)) is a fine alternative), and, more
importantly, has apparently not caused confusion among students.
Again, for similar reasons to those
On Monday 04 September 2006 8:56 pm, Dethe Elza wrote:
On 4-Sep-06, at 5:45 PM, Andre Roberge wrote:
The following is something I have been pondering for quite a while now
and am wondering what other people on this list think.
According to PEP 3100
Is this what you're looking for:
d = dict(key1=52, key2=12)
d
{'key2': 12, 'key1': 52}
Of course this only works for keys that are strings.
--John
On Tuesday 15 August 2006 1:28 am, kirby urner wrote:
Someone (Dethe? Ian?) showed me syntax I'd never seen before around
Python dictionary
On Thursday 10 August 2006 10:24 am, Paul D. Fernhout wrote:
What about constructors like
Line origin: 10 @ 10 angle: 35 degrees distance: 10 mm
(which is easy to have in Smalltalk syntax) and so on? And I bet you can
read what it means not even knowing Smalltalk. Would you rather read:
:-) In
the paper, this was done in a lazy functional language. I was mostly
interested to see how it would translate to a Python generator.
# pi.py -- imlementation of Gibbons' spigot algorithm for pi
# John Zelle 4-5-06
def pi_digits():
generator for digits of pi
q,r,t,k,n,l = 1,0,1,1,3,3
On Thursday 11 May 2006 16:19, you wrote:
snip
We're straying a bit from the original thread here, but I couldn't resist this
comment.
Ergo my point: I don't look to mathematicians to tell me how to write
math, but to computer scientists such as Kenneth Iverson. Although
sure, I'll take
On Saturday 06 May 2006 11:40, Winston Wolff wrote:
On May 6, 2006, at 11:25 AM, John Zelle wrote:
To me, it seems that a 2D/3D persistent scene-graph API paired
with a GUI
toolkit, both based on PyOpenGL is the obvious first step toward
this goal.
snip
But I'd like some clarification
This has been an interesting thread. I haven't had time to contribute, but I
saw something here that I felt I had to address.
On Sunday 30 April 2006 14:47, kirby urner wrote:
On 4/30/06, Michael Tobis [EMAIL PROTECTED] wrote:
Most kids, most humans in general, will voluntarily spend many
On Tuesday 28 March 2006 09:42, kirby urner wrote:
So we have different levels of mutability. A complex type which
doesn't allow resassignment of real and imaginary parts might look
like:
Immutable:
c = Complex(1,2)
c = c.real(3) # assigning a new value
c = c.imag(4) # yet another new
Since my name was invoked recently on this thread (albeit with a question
mark), let me try to summarize:
We all agree that mutability introduces interesting issues, particularly in
the face of true concurrency. Language designers are very interested in
languages with semantics that avoid or
On Saturday 18 March 2006 16:39, Michael Tobis wrote:
So, is there a problem with wrapping them thus:
###
class mcx(object):
def __init__(self,val):
self.val = complex(val)
def __add__(self,other):
and similarly for most other special methods
return
I also like the simplicity of lightning, but it would need some enhancements
before I could imagine using it in class. For example, it doesn't seem to
auto-indent and requires typing the filename on a save. I'm sure it would not
be hard to tidy up those things. I'd also like to handle multiple
Kirby Urner wrote:
I think there's a shortage of computer pros with strong presentation skills.
Like, at Europython we got a 5 minute upbraiding by one of the few female
geeks, complaining that we collectively mumbled too much, failed to project
our enthusiasm for our topics. We must do more
Arthur wrote:
A business trip had me passing through New Haven. As a lover of books, and
therefore bookstores, I took the opportunity to stop to look for a bookstore
near the Yale campus - figuring I would find a bookstore with significantly
more depth than those to which I normally have
Carlos,
I doubt that you'll get much disagreement on this list about Python
being an excellent first language choice. Hence, there is unlikely to be
much of a discussion. I wrote a paper titled Python as a First
Language back in 1998, you can find it at:
http://mcsp.wartburg.edu/zelle/python
As usual, I don't have time to comment on all the intriguing things that
have come out of this thread. But gender balance is something that I've
spent a lot of time thinking about and working on as regards our own
program. So I felt compelled to say something.
Laura Creighton wrote:
Why
On Wed, Sep 21, 2005 at 09:31:41AM -0700, Kirby Urner wrote:
Of course all of this requires temporarily ignoring the fact that algebraic
methods give us a way to compute phi as simply (1 + math.sqrt(5))/2.0.
I've been considering this a bit. The closed form here begs the
question, what is
David Handy wrote:
On Wed, Sep 21, 2005 at 09:31:41AM -0700, Kirby Urner wrote:
Mine original draft makes sense to set the stage, cuz the reasoning is so
dang primitive. Yours adds a layer of sophistication more reflective of how
real world programmers learn to squeeze the most out of their
Arthur wrote:
My only objection to it being there - in fact - is the lack of consensus as
to the compelling reason it is necessary. There seems to be agreement, in
fact, on only this one aspect of the reason for its presence as a built_in
function. The fact that the reason is
Arthur,
It often seems to me that I agree with you, but you think that you don't
agree with me. This may be one of those cases.
Arthur wrote:
-Original Message-
I'm confused I tell you ;)
Scott David's Triangle did *not* use a property for area. I think that was
quite
Hello all,
For those of you who use my graphics.py library for teaching, I wanted
to let you know that I've just released an update to version 3.2. This
version has two important improvements over the last release (3.0):
1. Significantly improved performance of communication with the Tk
Toby Donaldson wrote:
For instance, to write an efficient queue data structure (where adding
and removing form the queue are always constant-time operations) in
LISP/Scheme requires using arrays.
Hi Toby,
I don't think this is a valid criticism. If the point of using a queue is
to teach how
Arthur wrote:
Floris Bruynooghe has created a VPython Debian distribution and is in
process of attempting to have it accepted as official Debian package.
Not being familiar with the process I am having trouble following the
dialogue - sponsorship vs. adoption, etc.
Obviously I would like to see
Lloyd Hugh Allen wrote:
On Wed, 23 Mar 2005 14:02:15 +0200, Linda Grandell [EMAIL PROTECTED] wrote:
I wonder if letting the students pair up for themselves could work? That
would more or less be a variant of the second alternative above. Or does
this introduce the risk of weaker students pairing
Kirby,
Thanks for the update. I had tried to run this earlier and noticed the
missing dependency, but had not yet tracked down what was up. I've got
it running now (with a couple tweaks for Python 2.3).
This is a nifty application for demonstrating stereo visualization. Just
set scene2.stereo
Hans,
There are lots of sources for the cheap (= $0.40 US) anaglyph
(red-blue) glasses on the net. I have recently ordered from
RainbowSymphony and had decent results (not wild about the packaging but
otherwise fine).
As for the shutterglasses, it depends on what you are trying to achieve.
Hans,
I know you are already in communication/waiting for a bugfix on this,
but I have a quick inquiry. This sounds related to issues I've had with
my graphics library (now solved, knock on wood). I would think that
running IDLE -n would solve this problem for you. Please see my question
70 matches
Mail list logo