Re: [Tutor] Using sys.exit()

2006-10-31 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote > I'd like to know how to use sys.exit() to quit a program. > I see that you already figured that out. You can also quit by raising SystemExit, which is what sys.exit does... but you don't need to import sys... > Is there a way to use it the way I want to?

Re: [Tutor] Suggestions about documenting a function

2006-10-31 Thread Alan Gauld
"Jorge Azedo" <[EMAIL PROTECTED]> wrote > import random > > def randomList(n1,n2,len): >'''n1-n2 range of numbers, len - length of the final list > >Returns a list''' Don't worry too much about writing the doc string to fit in the IDE hint box. Think more about how it will look when peop

Re: [Tutor] question about pylab

2006-10-31 Thread Markus Rosenstihl
Am 31.10.2006 um 08:35 schrieb shawn bright: > hey there, > i am trying to use a graph and chart app called matplotlib, but i > cannot figgure out how to have it plot a simple chart over time. > the docs say to use the function plot_date() but i cannot seem to get > the values to agree. > I am

Re: [Tutor] question about pylab

2006-10-31 Thread Kent Johnson
shawn bright wrote: > hey there, > i am trying to use a graph and chart app called matplotlib, but i cannot > figgure out how to have it plot a simple chart over time. > the docs say to use the function plot_date() but i cannot seem to get > the values to agree. > I am sending datetimes to the ch

[Tutor] immutable objects

2006-10-31 Thread Premnath Sah
Hi,from http://docs.python.org/ref/objects.htm """Types affect almost all aspects of object behavior. Even the importance of object identity is affected in some sense: for immutable types, operations that compute new values may actually return a reference to any existing object with the same type a

Re: [Tutor] question about pylab

2006-10-31 Thread shawn bright
ok, looks like the date2num() function on a datetime.datetime object is working. So cool.i am very new at this, so i may be back ( read probably be back ). Thanks much for the tips.i appreciate it a lot.sk On 10/31/06, Kent Johnson <[EMAIL PROTECTED]> wrote: shawn bright wrote:> hey there,> i am tr

Re: [Tutor] immutable objects

2006-10-31 Thread Kent Johnson
Premnath Sah wrote: > I would like to know how i can guarantee that a new immutable object is > infact a new object. > > Example: > > >>> a = 1 > >>> b = 1 > >>> a is b > True > > is what i get. i want a and b to be two different object. I don't think there is any way to control this for th

[Tutor] M Arch Thesis

2006-10-31 Thread Carlos
Hi to all, For my Thesis project, I want to use a Genetic Algorithm to generate multiple spatial organization solutions for Architectural projects. My idea is that a software that does this would be useful as a rapid prototyping tool and more important it will probably reach solutions that a h

Re: [Tutor] immutable objects

2006-10-31 Thread Danny Yoo
> Im facing a problem with SOAPpy which checks for recursive objects using > id(obj). > > In my case value for 2 SOAP headers are same and iam getting a recursion > error. if i pass different object with same value SOAPpy does not complain > (by using str(value) and unicode(value)). If you can inc

[Tutor] senior project

2006-10-31 Thread patrat
i am a senior in high school, my school requires me to get a mentor and interview 2 people for my senior project. i am wondering if any one would be my mentor or be willing to answer some questions. if you are interested please email me  ___ Tutor maillis

Re: [Tutor] immutable objects

2006-10-31 Thread Premnath Sah
On 10/31/06, Kent Johnson <[EMAIL PROTECTED]> wrote: Premnath Sah wrote:> I would like to know how i can guarantee that a new immutable object is> infact a new object.>> Example:>>  >>> a = 1>  >>> b = 1 >  >>> a is b> True>> is what i get. i want a and b to be two different object.I don't think th

[Tutor] Mapping to object attributes

2006-10-31 Thread Mike Hansen
I've got a web form with a lot of form fields. I'd like to be able to map the form fields to an object's attributes. I'm having a little trouble figuring out how. I was thinking of something like this.. form = cgi.FieldStorage() widget = Widget() form_field_object_map = {'widget_name' : widget.

Re: [Tutor] Mapping to object attributes

2006-10-31 Thread John Fouhy
On 01/11/06, Mike Hansen <[EMAIL PROTECTED]> wrote: > form = cgi.FieldStorage() > widget = Widget() > > form_field_object_map = {'widget_name' : widget.name, > 'alt_widget_name' : widget.alt_name, > ...} > > for form_field in form_field_obje

[Tutor] One million and counting

2006-10-31 Thread Alan Gauld
Hi folks, In just thought I'd mention that my web tutor has now passed the million visitors mark. Thanks to all those on the tutor list who have paid a visit. Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld _

Re: [Tutor] One million and counting

2006-10-31 Thread Chris Hengge
Very cool! Congrats!On 10/31/06, Alan Gauld <[EMAIL PROTECTED]> wrote: Hi folks,In just thought I'd mention that my web tutor has now passedthe million visitors mark. Thanks to all those on the tutorlist who have paid a visit.Alan GauldAuthor of the Learn to Program web site http://www.freenetpages

[Tutor] Simple calculator

2006-10-31 Thread Joe Cox
I found this simple calculator on the web: from Tkinter import * from math import * ###http://sunsite.uakom.sk/sunworldonline/swol-02-1998/swol-02-python.htmlBy Cameron Laird and Kathryn Soraiz...Getting Started with Python### def evaluate(event): label['text'] = "Result: " + str(eval(ex

Re: [Tutor] Mapping to object attributes

2006-10-31 Thread Alan Gauld
"Mike Hansen" <[EMAIL PROTECTED]> wrote > I've got a web form with a lot of form fields. I'd like to be able > to map > the form fields to an object's attributes. I'm having a little > trouble > figuring out how. John has answered that bit. > There will be some fields I'll need to validate(bo

Re: [Tutor] One million and counting

2006-10-31 Thread Jorge Azedo
Congrats! I know that what I know about Python I learned from your guide, so a personal thanks from me :) Alan Gauld wrote: > Hi folks, > > In just thought I'd mention that my web tutor has now passed > the million visitors mark. Thanks to all those on the tutor > list who have paid a visit.

[Tutor] python and mingw home directory problem

2006-10-31 Thread Peter Wig
Hi everyone,I'm trying to run some commands with mingw from python.  However, somehow my home directory (for mingw) is being changed when I initialize tk.  Here's an example:import osfrom Tkinter import Tkos.system("C:/msys/1.0/bin/sh.exe --login -i -c 'pwd'  ") # just print my home directoryroot =

Re: [Tutor] One million and counting

2006-10-31 Thread Terry Carroll
On Tue, 31 Oct 2006, Alan Gauld wrote: > In just thought I'd mention that my web tutor has now passed > the million visitors mark. Thanks to all those on the tutor > list who have paid a visit. I've visted that site a few times. Thanks and congratulations.

[Tutor] off topic GNOME background

2006-10-31 Thread Amadeo Bellotti
my background just disappeared it shows a black screen like it cant find the default background. if that makes sense I've added my own and it cant seem to find it i removed it and re added it it doesn't seem to be working though anyone have any ideas? ___

Re: [Tutor] Suggestions about documenting a function

2006-10-31 Thread Jorge Azedo
Thanks for all your help guys, but after trying to read just bits and pieces of the manual and not understanding a single sentence, much less a single chapter, I decided to just put this function on hold until I read the whole Tutorial from start to finish. I just hope it doesn't take to long..

Re: [Tutor] Running multiple version of Python on 1 windows

2006-10-31 Thread Tony Cappellini
>From Kent >>You don't say what OS you are running but under Windows it is trivial to>>have multiple versions of Python installed, I have 2.3, 2.4 and 2.5.>>They are each in their own directories, all in the system path. I have >>aliases called py23, py24 and py25 that let me launch the version I>>

Re: [Tutor] One million and counting

2006-10-31 Thread Glenn T Norton
Alan Gauld wrote: >Hi folks, > >In just thought I'd mention that my web tutor has now passed >the million visitors mark. Thanks to all those on the tutor >list who have paid a visit. > >Alan Gauld >Author of the Learn to Program web site >http://www.freenetpages.co.uk/hp/alan.gauld >

Re: [Tutor] immutable objects

2006-10-31 Thread Premnath Sah
On 10/31/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > Im facing a problem with SOAPpy which checks for recursive objects using> id(obj).>> In my case value for 2 SOAP headers are same and iam getting a recursion> error. if i pass different object with same value SOAPpy does not complain > (by using s