Re: [Tutor] Lamdas and locality

2007-03-04 Thread Michael Meier
Thanks for your answer and your workaround! There's always something to
learn about lambdas and variable scope in Python ;)

I'm sorry I didn't delete the quoted Tutor Digest part, it was a stupid
mistake :(


cheers,
Michael

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


Re: [Tutor] httpd in your laptop?!? serve web pages and wikis in y our notebook?

2007-03-04 Thread Andreas Kostyrka
forth and postscript are both rpn notated languages. stack oriented languages 
include also other stuff, e.g. the jvm assembly language. (Although the 
security verifier does place rather strict limitations on the allowed stuff)
but that's where the common things end. forth is a lowlevel language that 
manipulates memory directly, it's untyped too ;)

postscript otoh is a typed language with comparable safety to Python.

Andreas 

_ Ursprüngliche Mitteilung _
Betreff:Re: [Tutor] httpd in your laptop?!? serve web pages and wikis 
in your notebook?
Autor:  "R. Alan Monroe" <[EMAIL PROTECTED]>
Datum:  4. März 2007 1:14:34


> "Luke Paireepinart" <[EMAIL PROTECTED]> wrote
>>
>>> forth ... while very good for small programs
>>> to imbed into controller cpu's to bury inside some machine,

> It's a relatively little known fact that Sun use Forth as the
> monitor/bootloader  in their servers. When you do a shutdown
> on a Sun box it takes you into a Forth interpreter!

>>> different that rank beginners learn it faster than experienced 
>>> hands
>>> do. it's just so damn odd.

> Yep, it's one of the few languages that I just gave up on,
> the pain wasn't worth the gain. I wound up moving to Tcl;
> and Tcl isn't exactly mainstream! But it was a lot more
> conventional than Forth. The only language I've used that
> was equally different was Prolog.

Postscript borrows heavily from Forth, I think.

Alan

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


Re: [Tutor] httpd in your laptop?!? serve web pages and wikis in y our notebook?

2007-03-04 Thread Kent Johnson
Andreas Kostyrka wrote:
> forth and postscript are both rpn notated languages. stack oriented 
> languages include also other stuff, e.g. the jvm assembly language. 

The CPython virtual machine is also a stack-based language. The 
operations are defined here:
http://python.org/doc/current/lib/bytecodes.html

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


[Tutor] How does datetime.now() get timezone?

2007-03-04 Thread Christopher Arndt
Hi all,

this is maybe more of a Linux question or about how Python plays together with
the OS:

I have a virtual server on which I installed Ubuntu Dapper LTS with a minimal
install plus the things I needed. If I do

from datetime import datetime
t = datetime.now()

there, 't' is a naive datetme object, i.e. t.tzinfo is None.

If I do the same on my developing machine, which has also Ubuntu Dapper, I get
a timezone-aware datatime object.

What do I have to do to set the timezone so that Python can recognize it? I
already installed the 'locales' package, ran 'tzconfig' and installed
timezoneconf and ran that, but to no avail.

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


[Tutor] basic plotting questions (pyplot vs matplotlib, etc)

2007-03-04 Thread Che M
I'd like to learn to use basic plotting in a wxPython GUI app,
with plots embedded in the GUI.  Some questions about this:

1) Of pyplot or matplotlib, which might you recommend?  My needs are:

- embedded plots in GUI (either can AFAIK)
- basic point/line/pie/bar graphs, regression lines, clickable points. (not 
sure if pyplot does regression
  lines or pie charts.)
- get the datapoints from a SQLite database queries
- reasonably do-able for a determined beginner programmer (me)
- not too memory intensive/app-bloating

Clearly matplotlib can do it all but I'm unsure if it is overkill for my 
needs?

2) What does "DC" mean?  As in wxDC?

3) I'd like to try a simple embedded plot in pyplot to get started.  Boa 
Constructor will place
a plot canvas to start, but I'm having trouble wading through the code of 
the pyplot example
from the wxPython demo.  Could someone help me with the barest bones of a 
simple line
plot on a canvas?  Just x = (1,2,3,4,5), y = (2,4,6,8,10) sort of thing.

TIA,
Che

_
Mortgage rates as low as 4.625% - Refinance $150,000 loan for $579 a month. 
Intro*Terms  
https://www2.nextag.com/goto.jsp?product=10035&url=%2fst.jsp&tm=y&search=mortgage_text_links_88_h27f6&disc=y&vers=743&s=4056&p=5117

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


Re: [Tutor] basic plotting questions (pyplot vs matplotlib, etc)

2007-03-04 Thread Alan Gauld
"Che M" <[EMAIL PROTECTED]> wrote 

> 1) Of pyplot or matplotlib, which might you recommend?  

Sorry, no real experience of either.

> 2) What does "DC" mean?  As in wxDC?

I'm guessing, but based on my previous experience of 
other GUIs, it will be a Device Context. A DC is a concept which 
tries to abstract the hardware used for graphics so that you 
can create the same graphic and display it on a screen or on 
a printer with minimal change. You just pass in the appropriate 
DC to the graphics functions. This is good for WYSIWYG type 
work, but can mean that "simple" priniting (eg text) is much more 
difficult than would normally be the case!

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