Re: [Tutor] Inherit from int?

2007-05-12 Thread jim stockford
the problem is in the return. if you append a print statement to the class function such as print "number is ",number # (properly indented, of course) you'll get 8 On May 12, 2007, at 5:11 PM, John Fouhy wrote: > On 13/05/07, Marilyn Davis <[EMAIL PROTECTED]> wrote: >> #!/usr/bin/env python

Re: [Tutor] Python fast enough for ad server?

2007-05-09 Thread jim stockford
there's also the question of the delivery architecture: if there are multiple machines in a clustered configuration, even something such as DNS round robin, then improving performance is a matter of throwing machines at the front end. On May 9, 2007, at 1:17 PM, Alan Gauld wrote: > > "OkaMth

[Tutor] Squlite3 problem

2007-03-13 Thread Jim Roush
I'm geting the following error message and I'm stumped Traceback (most recent call last): File "C:\markets\source\QuantScan\QuantScan4_3.py", line 1362, in db.close() sqlite3.OperationalError: Unable to close due to unfinalised statements Here 's the relevant code db = sqlite.conn

Re: [Tutor] 'elp!!!!!!!1Totally Clueless Newbie In Distress

2007-01-21 Thread jim stockford
no need for apology on my side. there's no agreed-upon and expressed policy. i like the model that we accept each other as we are. On Jan 20, 2007, at 7:10 AM, Karl Wittgenstein wrote: > Sorry for the swear words... > > 2007/1/20, Kent Johnson <[EMAIL PROTECTED]>: Karl Wittgenstein w

Re: [Tutor] Matching on multiple log lines

2006-10-28 Thread jim stockford
so it's guaranteed that 'Writing Message to' will always be followed by 'TRANSPORT_STREAM_ID' before the next occurrence of 'Writing Message to' and all text between can be ignored, and we increment the counter if and only if there is a newline immediately after 'TRANSPORT_STREAM_I

[Tutor] what.built-in

2006-09-29 Thread jim stockford
from http://docs.python.org/lib/built-in-funcs.html some functions are always available--the built-in functions. (from elsewhere) everything in python is an object. hey, from abs() to zip() there's type() and super() and str() and setattr() and ... dir() and... they're the

Re: [Tutor] looping problem

2006-09-23 Thread jim stockford
t; Now I want to select ''GeneName ' into listA > and 'ATTAAGGCCAA' into listB > > so I want to select 0,3,6,9 elements into listA > and 2,5,8,11 and so on elements into listB > > then I can do dict(zip(listA,listB)) > > however, the ve

Re: [Tutor] looping problem

2006-09-23 Thread jim stockford
keep a counter in your loop. is this a homework question? On Sep 23, 2006, at 8:34 AM, kumar s wrote: > hi, > > the reason could be that I did not quite understand > the concept of looping > > I have a list of 48 elements > > I want to create another two lists , listA and listB > > I want to loo

Re: [Tutor] first programming project

2006-08-18 Thread jim stockford
i hope this helps: what a fun idea! do it! my way is to do a bad job fast then re-visit the plans and reimplement and test and re-visit and reimplement and test and consider writing a main program that does the primary work and outputs as text-only. maybe then create four clas

Re: [Tutor] Which Book

2006-08-17 Thread jim stockford
i think it's a mistake to concentrate on one book. Cull responses and pick three books to start with. The benefit is that where one book presents a poor explanation, another will do a good job (and one book will omit certain things that another presents). Also, you'll probably find you

Re: [Tutor] What does import really do?

2006-08-14 Thread jim stockford
y way of explaining my avoidance above. Might help to know I very much liked working in assembler and infer possible assembler correspondences when I wonder about code behavior. Your rundown of search order is helpful. more thanks. jim On Aug 14, 2006, at 7:52 PM, Luke Paireepinart wrote:

[Tutor] What does import really do?

2006-08-14 Thread jim stockford
For example, import os import sys My take is that one uses the import keyword in a program. The Python interpreter reads the program and generates machine code. The import keyword directs the Python interpreter to find some library (which is not necessarily named, certainly not necess

Re: [Tutor] Sorting a list of lists aka nested lists

2005-08-13 Thread Jim Roush
Danny Yoo wrote: >On Sat, 13 Aug 2005, Jim Roush wrote: > > > >>I have a python script that creates a list of lists like so: >> >>Quant.append( [ db_ticker, stock_close, MTD, 0, QTD, 0, YTD, 0, 0, 0 ] ) >> >>After Quant is created, I want to sort

[Tutor] Sorting a list of lists aka nested lists

2005-08-13 Thread Jim Roush
I have a python script that creates a list of lists like so: Quant.append( [ db_ticker, stock_close, MTD, 0, QTD, 0, YTD, 0, 0, 0 ] ) After Quant is created, I want to sort it by MTD. If I use a simple Quant.sort(), I assume its going to sort by 'db_ticker' which is not what I want. I've

[Tutor] Can't figure out AttributeError message

2005-07-07 Thread Jim Roush
I'm getting the following error message: AttributeError: 'tuple' object has no attribute 'seek' below is the code that produced the error. The line in question is marked with arrow in the left margin. Any help would be appreciated. def build_sp500_rand(): sp500_csv = open('c:/indic

Re: [Tutor] Python backwards program (fwd)

2005-04-14 Thread Jim and Laura Ahl
  i = raw_input("Enter a word.") print i[::-1] raw_input("\n\nPress the enter key to exit.")   Thanks for allowing me to take some of your precious time.   Jim - Original Message - From: Danny Yoo To: [EMAIL PROTECTED] Cc: Tutor Sent: Thursday,

Re: [Tutor] (no subject)

2005-04-14 Thread Jim and Laura Ahl
Jim and Laura Ahl said unto the world upon 2005-04-14 02:09:> How come when I ask it to print i[2:4] from an inputted string it> gives me the letters between two and four> > But when I ask it to print i[-1:-4] it does not print anything.> > Jim> Hi Jim,good to see you

[Tutor] (no subject)

2005-04-13 Thread Jim and Laura Ahl
How come when I ask it to print i[2:4] from an inputted string it gives me the letters between two and four   But when I ask it to print i[-1:-4] it does not print anything.   Jim ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman

Re: [Tutor] Python backwards program

2005-04-13 Thread Jim and Laura Ahl
cookie program that randomly gives one fortune out of 5 to the user.   Jim - Original Message - From: Feziwe Mpondo To: Alberto Troiano Cc: [EMAIL PROTECTED] ; tutor@python.org Sent: Wednesday, April 13, 2005 10:14 AM Subject: Re: [Tutor] Python backwards progr

[Tutor] Python backwards program

2005-04-12 Thread Jim and Laura Ahl
I am very new to programming and I have an assignment to have a raw_input string that is inputted by the user and then is printed backwards.  Can anyone help me?  I can get it to print regular but backwards in not working.   Thank You Jim

[Tutor] Re: Tutor Digest, Vol 11, Issue 29

2005-01-09 Thread Jim Kelly
i had the same probblem with xp. on mac os x i can double click on the file and it will open. xp opens the python file and closes it immediately apon double click open the python file via the Start Menu in xp. Then hit f5 and the script will run jk nj --- [EMAIL PROTECTED] wrote: > Send T

[Tutor] Re: Tutor Digest, Vol 11, Issue 30

2005-01-09 Thread Jim Kelly
This script did not run properly jk nj --- [EMAIL PROTECTED] wrote: > Send Tutor mailing list submissions to > tutor@python.org > > To subscribe or unsubscribe via the World Wide Web, > visit > http://mail.python.org/mailman/listinfo/tutor > or, via email, send a message with subjec

<    1   2   3   4   5   6