I am looking for a way to tell a object the properties of its containing object.
For example, I have an object foo, of class Bar, which I have stored in a dict
in the object I want to access. Basically:
container_object.contained_object["foo"].action()
What I want is for the object "foo" to be ab
On 23/06/2008, Dinesh B Vadhia <[EMAIL PROTECTED]> wrote:
> I have a program with 2 for loops like this (in pseudocode):
>
> fw = open(newLine.txt, 'w')
> for i in xrange(0, 700,000, 1):
> read a file fname from folder
> for line in open(fname, 'r'):
> do some simple string processi
There is no thrashing of disk as I have > 2gb RAM and I'm not keeping the file
contents in memory. One line is read at a time, some simple string processing
and then writing out the modified line.
From: Kent Johnson
Sent: Sunday, June 22, 2008 5:39 PM
To: Dinesh B Vadhia
Cc: tutor@python.or
On Sun, Jun 22, 2008 at 8:13 PM, Dinesh B Vadhia
<[EMAIL PROTECTED]> wrote:
> That's it. Very simple but after i reaches about 550,000 the program begins
> to crawl. As an example, the loops to 550,000 takes about an hour. From
> 550,000 to 580,000 takes an additional 4 hours.
>
> Any ideas abou
"Dinesh B Vadhia" <[EMAIL PROTECTED]> wrote
fw = open(newLine.txt, 'w')
for i in xrange(0, 700,000, 1):
read a file fname from folder
for line in open(fname, 'r'):
do some simple string processing on line
fw.write(newline)
fw.close()
From 550,000 to 580,000 takes an addi
I have a program with 2 for loops like this (in pseudocode):
fw = open(newLine.txt, 'w')
for i in xrange(0, 700,000, 1):
read a file fname from folder
for line in open(fname, 'r'):
do some simple string processing on line
fw.write(newline)
fw.close()
That's it. Very simpl
Jordan Greenberg wrote:
> def addcommas(s): # assumes type(s)==str
> b=[]
> l=len(s)
> for i,v in enumerate(s):
> i+=1 # easier to understand w/ 1-based indexing, i think.
> b.append(v)
>
> if (l-i)%3==0 and not i==l:
> b.append(',')
> return ''.
On Sun, Jun 22, 2008 at 3:50 PM, Zameer Manji <[EMAIL PROTECTED]> wrote:
> I'm quite new to OOP, so forgive me if I am missing something obvious.
> When you say that the User class should have a UserProfile as an
> attribute, would it look something like this?
>
> from lastfmapi import UserProfile
Hi!
I have reduced down and added a few features into the SAPI 5 speech
module I have created. You can now save and read wav files.
The test module tests most of the features I have in it at the moment.
I added the ability inside the Create method to set all the voice
parameters. Yo
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512
Kent Johnson wrote:
> A User class that has a UserProfile as an attribute, and accessors for
> Neighbors, etc, sounds good to me. You may want an Artist class,
> probably not a Top Artists class. The User.getTopArtists() method
> would access the web
On Sun, June 22, 2008 7:55 am, [EMAIL PROTECTED] wrote:
> hi Danny,
>
>
> As far as i am aware you must declare your variable first, something like
> a=0
That's a good thought. But he did initialize his variable.
The '!' and the '=' in '!=' are all smashed together without spaces.
So:
> whil
hi Danny,As far as i am aware you must declare your variable first, something like a=0The same would go for shope that helpspaulOn Sun Jun 22 10:45 , Danny Laya sent:Hi ! I have learned wiki tutor for non-programmer and I found some hill that stopping me. InĀ Non-Programmer's Tutorial for Python/C
Few... Thanks all, i have found the wrong, i miss some space between != and 0.
Thank's for the help. I really apreciate it !
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Sun, Jun 22, 2008 at 6:45 AM, Danny Laya <[EMAIL PROTECTED]> wrote:
> Hi ! I have learned wiki tutor for non-programmer and I found some hill that
> stopping me. In Non-Programmer's Tutorial for Python/Count to 10, wiki ask
> me to write this code :
>
> a = 1
> s = 0
> print 'Enter Numbers to a
But when i write while a != 0: and then i press enter,
python terminal tell me :
while a ! = 0:
File "", line 1
while a ! = 0:
^
SyntaxError: invalid syntax
Can you find my mistake, guys ? Sorry to bother you, I try to
Hi,
Python's trying to give you a hint:
while
Hi ! I have learned wiki tutor for non-programmer and I found some hill that
stopping me. In Non-Programmer's Tutorial for Python/Count to 10, wiki ask me
to write this code :
a = 1
s = 0
print 'Enter Numbers to add to the sum.'
print 'Enter 0 to quit.'
while a != 0:
print 'Current Sum:', s
On Sun, Jun 22, 2008 at 12:00 AM, Zameer Manji <[EMAIL PROTECTED]> wrote:
> I'm trying to create a library for the Last.fm webservice[1] and the
> first thing I created was a class for the Profile Information.[2] Is
> this the proper way of creating it? Is this useful to another programmer?
>
> imp
On Sun, Jun 22, 2008 at 4:03 AM, Alan Gauld <[EMAIL PROTECTED]> wrote:
> Web services are usually procedural in nature so that you don't
> need to create classes at all. So to provbide maximum flexibility
> you might be better just creating a module that exposes the
> services as functions. The us
"Zameer Manji" <[EMAIL PROTECTED]> wrote
Also, how do I then begin to approach the whole API ? Do I create a
User
class the inherits from the UserProfile class and other classes for
their Neighbours', Top Artists, etc ?
I don;t know enough about the underlying service to answer that but...
"Kent Johnson" <[EMAIL PROTECTED]> wrote
I'm pretty sure that page is out-of-date, Tkinter does not require
X11, it is integrated with Aqua.
This is true, as a recent posting confirmed re the limitations
of colouring buttons under Aqua. But...
Tkinter has a reputation as quick and ugly.
Th
20 matches
Mail list logo