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
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.
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
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
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
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
Sincerely, Luke
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
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
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
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
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
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
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
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
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
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
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
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
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
19 matches
Mail list logo