Re: [Tutor] Online class/education for Python?

2008-07-27 Thread wesley chun
> At $88 for 500 pages it had better be good or he will be stuxck
> with academic-only sales!


well, the other thing is that the 2nd review will really make ppl go
back to the original title since it's $18 vs. $88 for the (apparently)
same material, both academic and general sales. i can't imagine why
anyone would get the latter, hence what i think will drive sales all
to the former. it's fortunate that there are currently a lot of copies
out there, but again, this behavior is rarely the work of the author,
who has much less control over their material than one would
ordinarily believe.

another alternative that many have already recommended is How to Think
Like a Computer Scientist.  the 1st edition is available both in-print
and online, but the 2nd edition is only available online (for now).

1st: http://www.greenteapress.com/thinkpython/thinkCSpy/
2nd: http://openbookproject.net/thinkCSpy

oh, if there were only some other alternative for complete newbies to
programmers... say, um, a 2nd edition of Learn to Program?!? (yeah, i
keep teasing about this but i am kinda serious in some ways too [altho
i'm aware of the work involved in such an endeavor].) :)

on a tangential note, i may be asked to teach a private course to
individuals who have never formally learned to program before, and i'm
participating in this thread for a number of reasons, including the
fact that i'm trying to come up with a supplemental textbook to use in
addition to my course notes. i had envisioned the dawson book, but if
it's going OoP, i will have to come up with alternatives.

cheers,
-wesley
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Online class/education for Python?

2008-07-27 Thread Dick Moores

At 05:03 PM 7/26/2008, Alan Gauld wrote:


"wesley chun" <[EMAIL PROTECTED]> wrote


from the 2nd review for this author's "other" Python book, it could be
some nefarious actions from the publisher itself... no wonder it's
"out-of-print!"

http://amazon.com/dp/1423901126


At $88 for 500 pages it had better be good or he will be stuxck
with academic-only sales!


It's exactly as good as the 2nd edition! See the 2nd review at that link:

=
Careful buying this., May 17, 2008

While I won't deny this is the best book out there to teach someone 
Python, it is pretty much Word for Word the same book as Python for 
the Absolute Beginner (which is by the same author). This version is 
packaged as an academic book, and costs 4 times as much!

I love the author for this book, but the publisher should be shot.
Go pick up the absolute beginner version and saves yourself $60.

If it hadn't been the same book, I would happily given it 5 stars.
=

I can confirm this. I eagerly snatched it up when it came out, only 
to find that it was just a slick repackaging of what I already owned. 
Returned it the next day.


Dick


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] urllib2 and php authentication

2008-07-27 Thread Roel Schroeven

W W schreef:
On Sat, Jul 26, 2008 at 7:31 PM, Daniele <[EMAIL PROTECTED] 
> wrote:


Hi,
I'm trying to connect to a site that requires a php login. I used the
urllib2 module in the following way:


It requires a php login, or php handles the login?

 >>> import urllib2
 >>> user='xxx'
 >>> password='yyy'
 >>> hp = urllib2.HTTPPasswordMgr()
 >>> uri =
'http://s2.ikariam.it/index.php?action=loginAvatar&function=login
'
 >>> hp.add_password(None, uri, user, password)
 >>> opener = urllib2.build_opener(urllib2.HTTPBasicAuthHandler( hp))
 >>> req = urllib2.Request(uri)
 >>> opener.open(req).readlines()

Needless to say, it doesn't work. I get an html page back from the
opener saying username and/or password are invalid.
Can anyone point me in the right direction?


If php is handling the login, my guess is that it's receiving the info 
via either POST or GET.


And if you don't have access to the script, and you're not sure what the 
names of the values are, that might require some trial and error.


I suggest you use something like the Live HTTP Headers plugin in Firefox 
to see exactly what happens when you log in manually. That should give 
you enough information to do the same thing from your program.


--
The saddest aspect of life right now is that science gathers knowledge
faster than society gathers wisdom.
  -- Isaac Asimov

Roel Schroeven

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Online class/education for Python?

2008-07-27 Thread Danyelle Gragsone
On Sun, Jul 27, 2008 at 1:46 AM, Dick Moores <[EMAIL PROTECTED]> wrote:

> At 05:03 PM 7/26/2008, Alan Gauld wrote:
>
>  "wesley chun" <[EMAIL PROTECTED]> wrote
>>
>>  from the 2nd review for this author's "other" Python book, it could be
>>> some nefarious actions from the publisher itself... no wonder it's
>>> "out-of-print!"
>>>
>>> http://amazon.com/dp/1423901126
>>>
>>
>> At $88 for 500 pages it had better be good or he will be stuxck
>> with academic-only sales!
>>
>
> It's exactly as good as the 2nd edition! See the 2nd review at that link:
>
> =
> Careful buying this., May 17, 2008
>
> While I won't deny this is the best book out there to teach someone Python,
> it is pretty much Word for Word the same book as Python for the Absolute
> Beginner (which is by the same author). This version is packaged as an
> academic book, and costs 4 times as much!
> I love the author for this book, but the publisher should be shot.
> Go pick up the absolute beginner version and saves yourself $60.
>
> If it hadn't been the same book, I would happily given it 5 stars.
> =
>
> I can confirm this. I eagerly snatched it up when it came out, only to find
> that it was just a slick repackaging of what I already owned. Returned it
> the next day.
>
> Dick
>
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>

Aren't those different books? than PPftAB?

LN
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] newbie graphing question

2008-07-27 Thread Peter Petto
I'm about to try some Python programming for drawing simple geometric 
pictures (for math classes I teach) and was hoping to get some advice 
that will send me off in the best direction.


I want to write programs that can draw figures with commands akin to 
point(x,y) to draw a point at coordinates (x,y), or segment 
(x1,y1,x2, y2) to draw a segment between points (x1, y1) and (x2, y2)?


I'd appreciate recommendations as to the best facility or library to 
use to this end. I primarily use a Mac, but my students primarily use 
Windows.


I'd love to hear any and all pointers or comments. Thanks!


--
===

Peter Petto <[EMAIL PROTECTED]>
Bay Village, OH   tel: 440.249.4289
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Unable to Reconfigure IDLE

2008-07-27 Thread Tim Golden

Thomas Corbett wrote:


On Jul 26, 2008, at 9:02 AM, Alan Gauld wrote:



"Thomas Corbett" <[EMAIL PROTECTED]> wrote

Configured shell window to wrong size, now can't seem to find the 
menu  (Options > Configure) to resize the shell.


Don't you just resize it then close it and the next time it opens
it uses the new size?

Thats how I thought it was supposed to work!

Alan G

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor



The window is too large to resize.


I missed the beginning of this thread, but I assume that you
mean its edges are off the visible screen so you can't use
the mouse to grab the frame and resize it? If so, and if
you're on Windows, you can resize with the keyboard:
Alt-Space S will put you in Sizing mode; then use the
cursor keys to move the edges in and out. Alternatively,
Alt -Space M will put the window in Moving mode and, again,
the cursor keys can be used to bring a corner into view
and into range of the mouse.

TJG
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Online class/education for Python?

2008-07-27 Thread bhaaluu
On Sun, Jul 27, 2008 at 3:33 AM, wesley chun <[EMAIL PROTECTED]> wrote:
>
> on a tangential note, i may be asked to teach a private course to
> individuals who have never formally learned to program before, and i'm
> participating in this thread for a number of reasons, including the
> fact that i'm trying to come up with a supplemental textbook to use in
> addition to my course notes. i had envisioned the dawson book, but if
> it's going OoP, i will have to come up with alternatives.
>
> cheers,
> -wesley
>

While Python wasn't my first computer programming language, I found
the Dawson book (PPftAB2E) to be very approachable, and would highly recommend
it to anyone interested in learning Python. PPftAB2E is just a lot of
FUN to work
through, even if the student isn't planning on becoming a "game programmer."
It seems to cover all the Python basics.

I liked the fact that most of the 'games' used as example programs were text-
based games. The introduction to Python OOP was gentle, yet covered most
of the aspects of OOP without being overwhelming. Each chapter in the book
built on the previous chapter's examples.

I learned more about programming, reading/doing PPftAB2E, than from any other
programming book I've read/done. I'd like to repeat that the FUN factor was an
important aspect. Personally, I learn better and faster when I'm
having fun, than
when I have to learn something that is tedious from the very beginning.

Even though PPftAB2E uses games to teach Python, it never really gets
into PyGame.
Instead, it uses a customized version of a PyGame wrapper, called LiveWires.
LiveWires was developed to teach programming to kids in Great Britain. So if
a student goes through PPftAB2E, and wants to continue programming games,
I'd recommend "Game Programming" by Andy Harris [ISBN-13: 978-0-470-06822-9].
Game Programming is a fairly complete PyGame tutorial.

>From the Preface:


Let's face it: Games are fun. Games are what brought me into computer
programming
so long ago, and they're a big part of why I'm still in it. There's
something irresistible
about immersing yourself in an imaginary world. Books and movies are a great way
to experience a form of "alternative reality," but an interactive
computer game is
something more. You don't simple watch a game. You 'participate.'

If you think games are fun to play, you should try 'creating' them.
There's nothing
more fun than building your own gaming environment, and when you actually make
something that's exciting for others to play, you'll feel a rare sense
of accomplishment.
If playing games is more immersive than watching movies, writing games is even
more immersive than playing them. After all, the players are really
playing with a
universe constructed by you. In a sense they're playing with you.


PyGame is a Python wrapper around the extraordinary SDL library, which allows
beginning programmers to do some really incredible things, using the Python
language. The bottom line is: PPftAB2E is a fantastic book to use to
teach people
who have never programmed a computer before; and Game Programming is a
great follow-up book for those from the beginning class who want to continue
learning game programming with Python/PyGame. The PyGame crowd even have
their own website and mailing list: http://www.pygame.org/news.html

There are quite a few Python/PyGame examples on the PyGame website, so an
advanced Python class from the intermediate class would have lots of stuff to
take apart, modify, and put back together. Or, the class could team-build a game
for one of the Python/PyGame game competitions.

So there is a complete curriculum for you. I'm sure that students who
learned how
to program Python by learning to program games, would be well equipped to learn
how to program anything, from networked business apps, to Enterprise apps, or
anything else. They would be well-grounded Problem Solvers who have learned
how to learn. They probably had a lot of FUN learning how to learn, so it sticks
with them better, and longer, I'm so sure. 8^D

Happy Programming!
-- 
b h a a l u u at g m a i l dot c o m
Kid on Bus: What are you gonna do today, Napoleon?
Napoleon Dynamite: Whatever I feel like I wanna do. Gosh!
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] newbie graphing question

2008-07-27 Thread bhaaluu
On Sun, Jul 27, 2008 at 8:40 AM, Peter Petto <[EMAIL PROTECTED]> wrote:
> I'm about to try some Python programming for drawing simple geometric
> pictures (for math classes I teach) and was hoping to get some advice that
> will send me off in the best direction.
>
> I want to write programs that can draw figures with commands akin to
> point(x,y) to draw a point at coordinates (x,y), or segment (x1,y1,x2, y2)
> to draw a segment between points (x1, y1) and (x2, y2)?
>
> I'd appreciate recommendations as to the best facility or library to use to
> this end. I primarily use a Mac, but my students primarily use Windows.
>
> I'd love to hear any and all pointers or comments. Thanks!
> --
> ===
> Peter Petto <[EMAIL PROTECTED]>
> Bay Village, OH   tel: 440.249.4289
>

Hello Mr. Petto,

I'd recommend the PyGame library. PyGame is a Python wrapper around the
extraordinary SDL library. For an example program of what you might be looking
for, take a look at:

http://www.cs.iupui.edu/~aharris/pygame/ch05/paint.py

The whole site has a lot of Python/PyGame examples:
http://www.cs.iupui.edu/~aharris/pygame/

Andy Harris is a CS professor at Indiana University-Perdue University
Indianapolis,
and is the author of several books, including Game Programming
[ISBN-13: 978-0-470-06822-9], which is a fairly complete introduction
and tutorial
for PyGame.

Happy Programming!
-- 
b h a a l u u at g m a i l dot c o m
Kid on Bus: What are you gonna do today, Napoleon?
Napoleon Dynamite: Whatever I feel like I wanna do. Gosh!
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Online class/education for Python?

2008-07-27 Thread Alan Gauld

"wesley chun" <[EMAIL PROTECTED]> wrote

oh, if there were only some other alternative for complete newbies 
to
programmers... say, um, a 2nd edition of Learn to Program?!? (yeah, 
i
keep teasing about this but i am kinda serious in some ways too 
[altho

i'm aware of the work involved in such an endeavor].) :)


I might be able to contemplate such a task in the near future.
I'm not sure whether the publisher would be keen though, sales
are steady but hardly best-seller - an inherent risk when you
publish a web version too! In fact my biggest sales are currently
in Japan (where I assume there is a more limited range of Python
books available!).

If I did do a 2nd edition I'd probably aim it at Python 3.0 - which
would give me the motivation to start looking at V3 more closely.

--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] newbie graphing question

2008-07-27 Thread Alan Gauld

"Peter Petto" <[EMAIL PROTECTED]> wrote

I want to write programs that can draw figures with commands akin to 
point(x,y) to draw a point at coordinates (x,y), or segment 
(x1,y1,x2, y2) to draw a segment between points (x1, y1) and (x2, 
y2)?


Most GUI toolkits will have a Canvas widget or similar that allows
drawing at that level. Also the standard turtle module might be
helpful with supoport for turtle graphics. Finally there are Python
plotting libraries that can be used for graphing and charts

However the GUI toolkits have the big disadvantage that you have to
build a GUII and all the controls before you can use the Canvas. That
migt not be what you want. Or you may want to build a basic framework
that your students can start from.

I'd appreciate recommendations as to the best facility or library to 
use to this end. I primarily use a Mac, but my students primarily 
use Windows.


Standard Tkinter or wxPython both work on the Mac.

It depends on whether you want to teach graphics programming or
just graphics for data presentation. If the latter you are probably 
better

off with a standard spreadsheet like Excel.

HTH,

--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 



___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Online class/education for Python?

2008-07-27 Thread Dick Moores

At 04:09 AM 7/27/2008, Danyelle Gragsone wrote:


Aren't those different books? than PPftAB?


Your acronym has lost me, but _Programming Python for the Absolute 
Beginner_, 2nd ed. is essentially the same book as the much more 
expensive _Guide to Programming with Python_.


Dick
===
Have you seen Kelie Feng's video introducing the terrific and free
IDE, Ulipad? 
Get Ulipad 3.9 from 
svn for the latest revision 
Mailing list for Ulipad: 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Online class/education for Python?

2008-07-27 Thread Danyelle Gragsone
On Sun, Jul 27, 2008 at 7:54 AM, Dick Moores <[EMAIL PROTECTED]> wrote:

> At 04:09 AM 7/27/2008, Danyelle Gragsone wrote:
>
>  Aren't those different books? than PPftAB?
>>
>
> Your acronym has lost me, but _Programming Python for the Absolute
> Beginner_, 2nd ed. is essentially the same book as the much more expensive
> _Guide to Programming with Python_.
>
> Dick


That acronym has been used throughout this thread to mean the same book you
are talking about _Programming Python for the Absolute Beginner_, 2nd.
essentially and the same isnt the exact same thing ;).

:)
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] newbie graphing question

2008-07-27 Thread arsyed
On Sun, Jul 27, 2008 at 8:40 AM, Peter Petto <[EMAIL PROTECTED]> wrote:
> I'm about to try some Python programming for drawing simple geometric
> pictures (for math classes I teach) and was hoping to get some advice that
> will send me off in the best direction.
>
> I want to write programs that can draw figures with commands akin to
> point(x,y) to draw a point at coordinates (x,y), or segment (x1,y1,x2, y2)
> to draw a segment between points (x1, y1) and (x2, y2)?
>
> I'd appreciate recommendations as to the best facility or library to use to
> this end. I primarily use a Mac, but my students primarily use Windows.
>
> I'd love to hear any and all pointers or comments. Thanks!
>


Take a look at PiScript:

http://www.math.ubc.ca/~cass/piscript/docs/piscript.html
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] plotting graphs

2008-07-27 Thread James Mithen
I'd personally recommend the matplotlib plotting library.  It has a
matlab style plotting interface.  The only work required by you would
be to write a few one line functions that wrap the
matpotlib.pylab.plot() function call.  Your students on windows could
use idle as a back end (you have to have idle in interactive plotting
mode for it to work, but that is fine unless you are doing some pretty
heavy graphing).

James M


> On Sun, Jul 27, 2008 at 8:40 AM, Peter Petto <[EMAIL PROTECTED]> wrote:
>> I'm about to try some Python programming for drawing simple geometric
>> pictures (for math classes I teach) and was hoping to get some advice that
>> will send me off in the best direction.
>>
>> I want to write programs that can draw figures with commands akin to
>> point(x,y) to draw a point at coordinates (x,y), or segment (x1,y1,x2, y2)
>> to draw a segment between points (x1, y1) and (x2, y2)?
>>
>> I'd appreciate recommendations as to the best facility or library to use to
>> this end. I primarily use a Mac, but my students primarily use Windows.
>>
>> I'd love to hear any and all pointers or comments. Thanks!
>> --
>> ===
>> Peter Petto <[EMAIL PROTECTED]>
>> Bay Village, OH   tel: 440.249.4289
>>
>
> Hello Mr. Petto,
>
> I'd recommend the PyGame library. PyGame is a Python wrapper around the
> extraordinary SDL library. For an example program of what you might be looking
> for, take a look at:
>
> http://www.cs.iupui.edu/~aharris/pygame/ch05/paint.py
>
> The whole site has a lot of Python/PyGame examples:
> http://www.cs.iupui.edu/~aharris/pygame/
>
> Andy Harris is a CS professor at Indiana University-Perdue University
> Indianapolis,
> and is the author of several books, including Game Programming
> [ISBN-13: 978-0-470-06822-9], which is a fairly complete introduction
> and tutorial
> for PyGame.
>
> Happy Programming!
> --
> b h a a l u u at g m a i l dot c o m
> Kid on Bus: What are you gonna do today, Napoleon?
> Napoleon Dynamite: Whatever I feel like I wanna do. Gosh!
>
>
> --
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
> End of Tutor Digest, Vol 53, Issue 95
> *
>
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Online class/education for Python?

2008-07-27 Thread Dick Moores

At 07:18 AM 7/27/2008, bhaaluu wrote:


So if
a student goes through PPftAB2E, and wants to continue programming games,
I'd recommend "Game Programming" by Andy Harris [ISBN-13: 978-0-470-06822-9].
Game Programming is a fairly complete PyGame tutorial.


What do you think of _Beginning Game Development with Python and 
Pygame_, Apress, 2007?


Dick Moores
===
Have you seen Kelie Feng's video introducing the terrific and free
IDE, Ulipad? 
Get Ulipad 3.9 from 
svn for the latest revision 
Mailing list for Ulipad: 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Online class/education for Python?

2008-07-27 Thread Dick Moores


At 11:16 AM 7/27/2008, Danyelle Gragsone wrote:

On Sun, Jul 27, 2008 at 7:54 AM,
Dick Moores <[EMAIL PROTECTED]>
wrote:


At 04:09 AM 7/27/2008, Danyelle Gragsone wrote:


Aren't those different books? than PPftAB?



Your acronym has lost me, but _Programming Python for the Absolute
Beginner_, 2nd ed. is essentially the same book as the much more
expensive _Guide to Programming with Python_.


Dick


That acronym has been used throughout this thread to mean the same book
you are talking about _Programming Python for the Absolute Beginner_,
2nd. 
 From earlier in the thread: "I have the Second Edition of PPftAB,
and it was published in 2006."
 essentially and the same
isnt the exact same thing ;).
Nor did I say it was.
Dick



___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] newbie graphing question

2008-07-27 Thread Pierre Dagenais

Peter Petto wrote:
I'm about to try some Python programming for drawing simple geometric 
pictures (for math classes I teach) and was hoping to get some advice 
that will send me off in the best direction.


I want to write programs that can draw figures with commands akin to 
point(x,y) to draw a point at coordinates (x,y), or segment (x1,y1,x2, 
y2) to draw a segment between points (x1, y1) and (x2, y2)?


I'd appreciate recommendations as to the best facility or library to use 
to this end. I primarily use a Mac, but my students primarily use Windows.


I'd love to hear any and all pointers or comments. Thanks!



Hi Peter,
I'm just trying to do the same, draw points and lines without having to 
spend the next six months learning a GUI environment and then finding 
I've been learning the wrong one all this time. Then I stumbled on these 
pages at py4fun, it's a quick and dirty introduction to the basics of 
Tkinter, just a few commands and you're in business. Hope that is what 
you're looking for,

http://ibiblio.org/obp/py4fun/gui/tkPhone.html
http://ibiblio.org/obp/py4fun/wave/wave.html




___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor