Re: [Tutor] shelves behaving badly

2007-08-02 Thread Luke Jordan
time edits/reruns are made. thanks for the tip on checking things with os. On 8/2/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > > Luke Jordan wrote: > > i've implemented a database as a shelve of record class instances. some > > of the fields in each record are dictionaries

[Tutor] shelves behaving badly

2007-07-27 Thread Luke Jordan
i've implemented a database as a shelve of record class instances. some of the fields in each record are dictionaries. i needed to parse info from 3 different reports into the dictionary fields in each record instance. i wrote the code to do this and tinkered it to fit the different reports (i.e.

[Tutor] database question

2007-06-29 Thread Luke Jordan
I've created a database as a shelve, where each value in the shelve file is a record class instance that has attributes representing fields. Let's say I enter 300 records in the shelve, then I decide to add a field to future records, or remove a field from future records. How can I update the exis

Re: [Tutor] define vars by iteration

2005-10-24 Thread Luke Jordan
Thanks for this insight into classes. It often takes me a few days to absorb and respond because my job limits the time I can give to programming. But thanks again for taking the time to respond in a meaningful way.   I guess I could say that you changed my world when it comes to programming (sorr

Re: [Tutor] define vars by iteration

2005-10-20 Thread Luke Jordan
t;> classDictionary["Yard"]   the thing is I would like to be able to get at Yard's attributes by typing   >>> Yard.anAttribute garbage cans   at the prompt rather than   >>> Yard = classDictionary["Yard"] >>> Yard.anAttribute garbage cansIt

[Tutor] define vars by iteration

2005-10-19 Thread Luke Jordan
I've got a bunch of pickled class instances with self.name attributes, and I would like to assign the instances themselves to variables named whatever is stored in self.name using a function. "Can't assign to literal", right? Is there a way to do this?   Thanks,   Luke

[Tutor] Please excuse the previous message sent in error

2005-10-17 Thread Luke Jordan
Sincerely, Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Assign to vars by iteration

2005-10-17 Thread Luke Jordan
I've got a bunch of pickled class instances, and I'm trying to load them as variables using a function. The class has a self.name attribute, and I've got a list of self.name for all the instances pickled separately. When I would like to attach the names of each instance to the corresponding class

[Tutor] dictionaries in classes

2005-10-14 Thread Luke Jordan
Hi,   Another stumped beginner here.   I'm trying to have functions to create, edit and store dictionaries within a class. What I can't figure out is how to retain the edits after making them. I think it has something to do with namespace. Ideally I'd like to pickle class instances and be able to a

Re: [Tutor] Sum of List Elements

2005-09-24 Thread Luke Jordan
Thanks for the help everyone, for answering a simple question and pointing me toward more resources.On 9/24/05, bob < [EMAIL PROTECTED]> wrote:At 08:11 AM 9/24/2005, Luke Jordan wrote:>Hi All, >>I have spent an embarrassingly large amount of time trying to solve what>on its

[Tutor] Sum of List Elements

2005-09-24 Thread Luke Jordan
Hi All, I have spent an embarrassingly large amount of time trying to solve what on its face seems like a simple problem. I have a list of intergers, and I want to assign the sum of the intergers in the list to a variable. There are only intergers in the list. The best I have been able to do so

[Tutor] Filtering Spreadsheet Data

2005-05-23 Thread Luke Jordan
Hi All, I have several frighteningly cumbersome reports to review at my new job. I would like to write a python program to help me with my analysis. The goal of the program is to filter out information that doesn't meet certain requirements and print relevant results back to a legible report that

[Tutor] "Dispatching" functions with args

2005-04-13 Thread Luke Jordan
Hi! I am using a suggestion from this list to handle calling different functions conditionallly based on user input. What I'm trying to do is have functions that are 'configurable' in the sense that a choice from the user affects the way it performs. This works: def aFunc(): print "a

Re: [Tutor] Associate functinos with Dictionary/Class Usage

2005-04-08 Thread Luke Jordan
Yes, Danny - that makes sense. I was getting hung up how to handle the parens in this part dict['some'](thing) all clear now. :-) On Apr 7, 2005 4:40 PM, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > On Thu, 7 Apr 2005, Luke Jordan wrote: > > > I am looking

[Tutor] Associate functinos with Dictionary/Class Usage

2005-04-07 Thread Luke Jordan
Hi! My questions arose from reading the "Help with Classes" email that's been on this list for the past couple of days. I'm also writing a text game, but mine is puzzle not adventure. Anyway, someone mentioned that you can key words to a dictionary to have user input run functions. I am looking

[Tutor] Functions Calling Functions

2005-02-25 Thread Luke Jordan
Hi - I'm working on a command-line game. Is there anything wrong with having each 'chapter' of the game be a function that links to other chapters by calling them? I only ask because when a recent traceback returned about 40 lines worth of error message, I realized that the functions are all bein

Re: [Tutor] Print text position problems when using triple quotes

2005-02-24 Thread Luke Jordan
Execllent. Many Thanks, Luke On Thu, 24 Feb 2005 13:15:41 -0500, Bill Mill <[EMAIL PROTECTED]> wrote: > On Thu, 24 Feb 2005 13:14:13 -0500, Bill Mill <[EMAIL PROTECTED]> wrote: > > On Thu, 24 Feb 2005 10:02:44 -0800, Luke Jordan <[EMAIL PROTECT

[Tutor] Print text position problems when using triple quotes

2005-02-24 Thread Luke Jordan
Hi all, I've tried a lot of experimenting and searching through various tutorials, and I haven't been able to come up with a solution to this, ostensibly simple, problem. I'm writing a simple game (run in command line) in which narrative text is printed in response to a user's decisions. The prob

[Tutor] Case acceptance using raw_input

2005-02-15 Thread Luke Jordan
Hi all, thanks to all for running such a great list. Is there a better way for raw_input to accept both caps and lower case letters than: def aFunction(): action = raw_input("Perform an action?(y,n): ") if action == 'y' or action == 'Y': anotherFunction() elif action == 'n' or act