Ricardo Aráoz wrote:
> Kent Johnson wrote:
>> Andy Cheesman wrote:
>>> for thing in ["top", "right", "bottom", "left"]:
>>> eval("self." + thing).append("fish")
>> You don't need to use eval() here, use getattr() instead:
>> getattr(self, thing).append('fish')
>>
>
> What if you want to do :
>
Hey all!
My memory seem to have a horrible leak. How does one limit the amount of
decimal spaces for a float? I used to know that...
Example: not 5.398042156, but 5.4 (if I decide to have only one place).
Thanks in advance!
Toon Pieton.
___
Tutor maill
Toon Pieton wrote:
> Hey all!
>
> My memory seem to have a horrible leak. How does one limit the amount
> of decimal spaces for a float? I used to know that...
>
> Example: not 5.398042156, but 5.4 (if I decide to have only one place).
Usually you do this during display, while you leave the actual
Jon Crump wrote:
> I'm parsing a utf-8 encoded file with lines characterized by placenames
> in all caps thus:
>
> HEREFORD, Herefordshire.
> ..other lines..
> HÉRON (LE), Normandie.
> ..other lines..
>
> I identify these lines for parsing using
>
> for line in data:
> if re.match(r'[A-Z]{2
I'm parsing a utf-8 encoded file with lines characterized by placenames in
all caps thus:
HEREFORD, Herefordshire.
..other lines..
HÉRON (LE), Normandie.
..other lines..
I identify these lines for parsing using
for line in data:
if re.match(r'[A-Z]{2,}', line):
but of course this catches
maybe dis is what you want to do. Ijust made some changes to the code.
On 7/17/07, max baseman <[EMAIL PROTECTED]> wrote:
>
> hello all sorry to bother I'm working on my first curses program ive
> been wanting to learn curses for a while now and now that a have a
> lop top with fedora core runn
Que Prime wrote:
>
> With the help of a tutor I was able to get the following code to work
> the way I want, but I'd like for it to parse through several files in
> one folder and create one output file.
>
> I'm thinking I need to add something like:
>
> def grab_files(files = []):
Default values
With the help of a tutor I was able to get the following code to work the
way I want, but I'd like for it to parse through several files in one folder
and create one output file.
I'm thinking I need to add something like:
def grab_files(files = []):
found = []
if files != None:
Here is
>
>> I don't want to have to know the details of what makes my car run. All I
>> want to do is drive it from one location to another.
>>
>
> And one day your car doesn't start. So you blindly take it to a car mechanic
> (or even the dealership~shudder) where they hook it up to a battery char
Thanks for your help Kent
The error was that I was trying to assign to a non-assignable reference
as you highlighted. Everything works now
Thanks
Andy
Kent Johnson wrote:
> Andy Cheesman wrote:
>> for thing in ["top", "right", "bottom", "left"]:
>> eval("self." + thing).append("fish")
>
>
Andy Cheesman wrote:
> for thing in ["top", "right", "bottom", "left"]:
> eval("self." + thing).append("fish")
You don't need to use eval() here, use getattr() instead:
getattr(self, thing).append('fish')
> eval("self." + thing +"_extra")
> eval("self." + thing) = external_funct
Matthew,
I am also experimenting with ossaudiodev with python and was having the
same problem on my laptop, but not on my desktop - the reset() method
has solved this problem. However I want to be able to pause the played
file before it ends, but all the controls seem to be locked until the
sound
Dear people,
Sorry for the vague title, I'm struggling to define the problem but an
example will be better/clearer.
If I've a list of strings, which relate to objects(lists) elsewhere in
my code, I can call list action fine within the loop but I was wondering
how do I apply an external function as
13 matches
Mail list logo