haven't yet used it in anger,
> and am not sure what problems have been found in it.
I have found no problems with it - I've recently integrated it with my
event/component framework (1). In my library I use Process, Pipe
and Value.
cheers
James
1. http://pypi.python.org/pypi/circuits/
--
http://mail.python.org/mailman/listinfo/python-list
em can even run on other
nodes (you mentioned clustering).
Feel free to talk to me more about this in detail...
cheers
James
1. http://pypi.python.org/pypi/circuits/
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Jan 28, 2009 at 2:42 PM, James Mills
wrote:
(...)
> Might I recommend circuits (1) as a general purpose
> framework that you can build your application on top of.
>
> circuits will allow you to communicate with long-running
> background processes, communicate between proc
Jesse: Can I mail you off-list regarding multiprocessing ?
cheers
James
--
-- "Problems are solved by method"
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Jan 29, 2009 at 10:28 AM, alex23 wrote:
> On Jan 29, 7:32 am, Xah Lee wrote:
>> But he is really a asshole, and
>> take every chance to peddle his book.
>
> As opposed to really being an asshole and peddling one's website at
> every opportunity?
It would seem that Xah Lee suffers from a
t,
arg 1 is a tuple of two elements,
"somestring to execute" in globals()
and
locals()
which is also unlikely to be what you want. Neither of these are
giving you a string, file or code object, exactly as the interpreter
is telling you.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
h
erformance increase.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
If I read a windows registry file with a line like this:
"{C15039B5-C47C-47BD-A698-A462F4148F52}"="v2.0|Action=Allow|Active=TRUE|Dir=In|Protocol=6|Profile=Public|App=C:\\Program
Files\\LANDesk\\LDClient\\tmcsvc.exe|Name=LANDesk Targeted
Multicast|Edge=FALSE|"
with this code:
f=open('fwrules.reg2
On Thu, 29 Jan 2009 08:15:57 -, Hendrik van Rooyen
wrote:
"Rhodri James" wrote:
To:
Sent: Thursday, January 29, 2009 6:12 AM
Subject: Re: Exec woes
On Wed, 28 Jan 2009 07:47:00 -, Hendrik van Rooyen
wrote:
> This is actually not correct - it is the root cause
es :) I prefer Python!
I think you'll find a 3rd scenario:
Python developers (those that develop Python)
and Python programmers (those that use Python)
just don't really care about politics, protest and
all the rubbish that goes on in this list :)
cheers
James
--
http://mail.python.org/mailman/listinfo/python-list
[email protected] wrote:
> On Dec 25, 5:24 am, Xah Lee wrote:
>
> > The JavaScript example:
> >
> > // Javascript. By William James
> > function normalize( vec ) {
> > var div=Math.sqrt(vec.map(function(x) x*x).reduce(function(a,b)
> >
Imagine there are two files horse.py and buffalo.py. horse.py is imported by
another file rider.py. Is it possible to make it so that under certain
circumstances possibly based on an environment variable or something similar
that when rider.py imports horse.py, it actually imports buffalo.py sort o
Imagine there are two files horse.py and buffalo.py. horse.py is imported by
another file rider.py. Is it possible to make it so that under certain
circumstances possibly based on an environment variable or something similar
that when rider.py imports horse.py, it actually imports buffalo.py sort o
[email protected] wrote:
Hi all
what IDE is the best to write python?
thanks
from Peter ([email protected])
vim in one terminal, ipython in the other.
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
On Sun, 01 Feb 2009 17:31:27 -, Steve Holden
wrote:
Stephen Hansen wrote:
[...]
don't play with anyone else's
privates.
A good rule in life as well as programming.
Unless, of course, you're both consenting adults.
What? Someone had to say it!
--
Rhodri James
, I would integrate
as best as you can into these libraries
without trying to add or rewrite too much.
Also, consider integrating with yolk
as well, as it provides some food features
and functionality that easy_install and pip
don't provide.
cheers
James
--
http://mail.python.org/mailman/listinfo/python-list
i package
manager :)
Trust me when I say this, the simpler you
make this, the better. "Powerful" is meaningless
in the context of programming - it has no
meaning. If you meant wxWindows/wxWidgets
are more feature-rich, then yes I agree - but
at what cost ? :)
My 2c,
cheers
James
--
http://mail.python.org/mailman/listinfo/python-list
operations on it.
Wanted to check first to see if something exists, and not reinvent the
wheel.
There's TreeCtrl, and CustomTreeCtrl. I don't know whether they can be
used with drag and drop,
Yes they can, at least after a fashion. See
http://wiki.wxpython.org/TreeControls
--
Rh
uch harder (though by no means
impossible) to break language-enforced hiding when (not if) an
interface turns out to be inadequate.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
xed the typo. DataFH
and ResourceFH are both local variables to __init__ and
will be tossed away when it finishes executing. If you
want to use them later, make them self.data_fh and
self.resource_fh respectively.
(PEP 8 recommends that you use lower_case_with_underscores
for variable or attribute names, and leave MixedCase for
class names.)
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
probably
w/o luck because afaik there is no way to track the event
of having random keys pressed the same time.
Yes there is. You need to use one of the GUIs (Tkinter, wxPython,
PyGame, etc), all of which will give you Key Down/Key Up events.
--
Rhodri James *-* Wildebeeste Herder to the Masses
it's that trivial to defeat something that its proponents appear to
want to be close to an iron-clad guarantee, what on earth is the point
of using "private" in the first place?
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 03 Feb 2009 05:37:57 -, Russ P. wrote:
On Feb 2, 7:48 pm, "Rhodri James" wrote:
On Tue, 03 Feb 2009 02:16:01 -, Russ P.
wrote:
> Here we go again. If you have access to the source code (as you nearly
> always do with Python code), then "breaking the l
den volte
face and declared that it was trivial to circumvent.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 04 Feb 2009 01:13:32 -, Russ P. wrote:
On Feb 3, 4:05 pm, "Rhodri James" wrote:
I'm very much of the second opinion; it was Russ who did the sudden
volte
face and declared that it was trivial to circumvent.
Whoa! Hold on a minute here. Your failure to understan
They provide a nice framework that will handle most of the annoying things.
With Django you don't need to write SQL (in a sense). etc..
On Wed, Feb 4, 2009 at 6:08 PM, Gilles Ganault wrote:
> Hello
>
> If I wanted to build some social web site such as Facebook, what do
> frameworks like Django o
#x27;t assigned to a name somehow), or just as easily
one or many names.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
What condition is "a height less
than 1/2 inch" in terms of your program?
(Hint: the condition isn't what I think you think it is -- remember that
"inches" is an int!)
How can I also take into account all the cases that need an exception?
How do you take care of any exception?
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
e
the traditional name to use. So:
def demo(action, **kwargs):
... print kwargs
...
demo(action="dummy", text="wombats are go")
{'text': 'wombats are go'}
You can also use it the other way round to expand a dictionary into
keyword parameters to a function call:
myargs = { 'action': 'avoid', 'where': 'Camelot', 'because': 'it is a
silly place' }
demo(**myargs)
{'because': 'it is a silly place', 'where': 'Camelot'}
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
enough" is an untangible question.
What you really -should- be doing is looking at the
bug reports (as you've mentioned) and determine whether
or not they will affect your use-case(s) in any way.
cheers
James
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Feb 6, 2009 at 10:48 AM, Nick Matzke wrote:
> (PS: Is there a way to force a complete reload of a module, without exiting
> ipython? Just doing the import command again doesn't seem to do it.)
m = __import__("mymobile")
reload(m)
cheers
James
--
http://mail.python
efinitely
possible.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
The name of the object is a name. It doesn't really exist as an
object at all.
As others have said, if you really want this information you'll need to
write your own class with a "name" attribute, and assign a suitable string
to it.
--
Rhodri James *-* Wildebeeste Herder to t
les are
optional, except for a couple of cases where you *have* to put them
in to avoid ambiguity. I tend to put them in always, but leaving them
out in cases like this seems to be normal practice.)
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Feb 6, 2009 at 3:21 PM, Volodymyr Orlenko wrote:
> In the patch I submitted, I simply check if the name of the supposed module
> ends with ".exe". It works fine for my case, but maybe this is too general.
> Is there a chance that a Python module would end in ".exe"? If so, maybe we
> shoul
Tim Chase wrote:
Is this where we tell you to shut up? ;-)
Don't you mean STFU?
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
that should terminate the event
chain. This is a general technique to stop a lot of unwanted event
propagation.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
I use Django for all simple apps and it works great!
On Sat, Feb 7, 2009 at 6:16 AM, Vincent Davis wrote:
> I have a simple script that takes a few input values and returns a csv file
> and a few stats. If I wanted to host this on the web how would I. I have no
> idea where to begin. If someone c
ame widgets that might be helpful to you. There is no need to
reinvent the wheel except for your own enlightenment.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
() except it is significantly slower and harder to
read.
Neither deal with quoted text, apostrophes, hyphens, punctuation or any
other details of real-world text. That's what I mean by "simple-minded".
You're missing something :-) Specifically, the punctuation gets swept
+= Y()
manager.send(Event(), "doThatFunkyFunk")
cheers
James
[1] http://pypi.python.org/pypi/circuits/
--
http://mail.python.org/mailman/listinfo/python-list
tomagically"
improve the execution speed of a single
function - let alone an application.
Your problem must be capable of being divided up
into work units that can be parallelized. If this is not
possible, multiple cores (no matter how many you have)
-will not- help you.
cheers
James
--
http://mai
tring methods, and string interpolation!
So the moral of this story is take a ball of strings with you for
when you get lost in regular expressions.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
to
do it in Python, the only thing that springs to mind is
periodically checking the size of the file and reading more
when that changes. You'll need to be very careful to keep
what size you think the file is in sync with how much you've
read!
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
creating a new list.
a = [1, 2, 3]
b = a
a.append(4)
print b
Here, the list has both labels 'a' and 'b' attached to it. When we
call a.append, it doesn't create a new list or anything like that,
it just makes the existing list larger and tacks the
On Thu, 12 Feb 2009 16:44:56 -, W. eWatson
wrote:
I simply ask, "How do I get around the problem?"
Run your program from the command line, or by double-clicking.
You've been told this several times now.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://
.
I then went to another machine that has never had pythonWin on it all,
but does have python 2.5.2 with IDLE. I ran the same program there. W2K.
In both cases, I got the output below. Your conclusions?
That you haven't listened to a word anyone has said.
--
Rhodri James *-* Wildebeeste H
plit("(\w+)", "The quick brown fox jumps, and falls
over.")[1::2]
['The', 'quick', 'brown', 'fox', 'jumps', 'and', 'falls', 'over']
Using this code how would it load each word into a temporary var
igit, I can
easily find myself executing an earlier version, differing as Dev4, to
Dev5 at the end of each name.
I'd suggest spending a while reading up on version control systems.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
This can be used as a great guide on writing pythonic code. Don't look at
the specific code that is being corrected but look at how the improvements
are being presented.
I would recommend someone who is learning python read this guide.
On Sun, Feb 15, 2009 at 12:17 AM, MRAB wrote:
> aiwarrior w
On Sat, 14 Feb 2009 05:03:13 -, W. eWatson
wrote:
See my response to Scott. Thanks for your reply.
I did. It was fundamentally mistaken in so many respects that
I formally give up on you.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo
cur to me...
What do you recommend?
It rather depends on what the files are. Some (clearly not this) will
be best coded as absolute paths. Probably your best bet otherwise is
to set an environment variable outside Python to point to the appropriate
directory, and read it out of the os.e
this is to gratuitously
subclass Test:
class AcceptableTest(object):
pass
class Test(AcceptableTest):
@accepts(int, AcceptableTest)
def check(self, obj):
print obj
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
André Thieme wrote:
> (map #(map (fn [s] (Integer/parseInt s)) (.split % "\\s")) (line-seq
> (reader "blob.txt")))
An error results:
java.lang.Exception: Unable to resolve symbol: reader in this context
This works:
(map #(map (fn [s] (Integer/parseInt s)) (.split % "\\s"))
(.split (slurp "ju
'xiong_chiamiov': {'name': 'James Pearson', 'distro': 'Arch'}}
The first time I pickle.load() it, I get this:
{'xiong_chiamiov': {'name': 'James Pearson'}}
The 2nd time, I get the full thing.
Is this a bug in pickl
Ah, thank you, you explained that quite well and opened my eyes to some
things I very much need to improve in my code. I'll keep those
list-etiquette things in mind next time.
On Sun, Feb 22, 2009 at 5:10 PM, Albert Hopkins wrote:
> On Sun, 2009-02-22 at 16:15 -0800, James Pears
post it, perhaps.
On the other hand a general recommendation from Programming Pearls
(Jon Bentley) is to convert code to data structures. Maybe you could
convert some of the code to decision tables or similar.
James
--
http://mail.python.org/mailman/listinfo/python-list
others to try it.
Python is a fantastic language and development environment.
Enough said.
Just remember thought that if you threat Python like a
hammer, suddenly everything will look like a bail.
cheers
James
--
--
-- "Problems are solved by method"
--
http://mail.python.org/mailma
Put your main function in a big
try, except. Catch any and all
errors and log them. Example:
def main():
try:
do_something()
except Exception, error:
log("ERROR: %s" % error)
log(format_exc())
Hope this helps.
cheers
James
On Wed, Dec 3, 2008 at 12:35 AM,
Pssft r, it's I that needs to get laid :)
--JamesMills
On Tue, Dec 2, 2008 at 4:07 PM, r <[EMAIL PROTECTED]> wrote:
> PS james,
>
> Since you are alex23's friend, do the world a favor...PLEASE GET ALEX
> LAID...before it's too late!
> --
> http://mail.
Hi Eriksson,
It's nice to see people actually contribute what they've learned back
to the community.
Great problem, well thought out solution and congrats on the learning :)
I can't say per say that I've actually run into a situation where I
need to sort file paths
in this way ... But if I do I'l
On Wed, Dec 3, 2008 at 4:44 AM, Benjamin Kaplan
<[EMAIL PROTECTED]> wrote:
>
>
> On Tue, Dec 2, 2008 at 1:36 PM, Craig Allen <[EMAIL PROTECTED]> wrote:
>>
>> > Just remember thought that if you threat Python like a
>> > hammer, suddenly everything will look like a bail.
>> >
>>
>> don't you mean if
You're a funny man r :)
Good luck with your endeavours!
I have a hard enough time convincing my work colleagues to use
anything other than PHP for everything!
Here PHP is the Hammer / Pitchfork!
--JamesMills
On Wed, Dec 3, 2008 at 8:16 AM, r <[EMAIL PROTECTED]> wrote:
> OK...so here are the stat'
scii_letters, digits
>>> chars = ascii_letters + digits
>>> chars
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
>>>
cheers
James
--
--
-- "Problems are solved by method"
--
http://mail.python.org/mailman/listinfo/python-list
uggh no!
On Thu, Dec 4, 2008 at 11:07 AM, Lawrence D'Oliveiro
<[EMAIL PROTECTED]> wrote:
> for \
>Entry \
>in \
>sorted \
> (
>f for f in os.listdir(PatchesDir) if PatchDatePat.search(f) != None
> ) \
> :
>Patch = (open,
> gzip.GzipFile)[Entry
On Thu, Dec 4, 2008 at 11:58 AM, alex23 <[EMAIL PROTECTED]> wrote:
> On Dec 4, 11:51 am, Barry Warsaw <[EMAIL PROTECTED]> wrote:
>> On behalf of the Python development team and the Python community, I
>> am happy to announce the release of Python 3.0 final.
>
> Thanks to you and everyone involved f
lf.i
self.i += 1
return i
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
taking rants like Warren's to heart because they
are born of honest frustration and practical concern. Hopefully
developers for python 2.7 are listening and won't break backward
compatibility just because the "Zen of Python" suggests it might be a
good idea.
James
-
The cookbook has a lot of complex examples and may not provide you with
the insight you are looking for. Only a small fraction of the recipes do
this.
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.pytho
t;, "id", "xs" or what not.
Readability of your code becomes very important
especially if you're working with many developers
over time.
1. Use sensible meaningful names.
2. Don't use abbreviations.
cheers
James
On Thu, Dec 4, 2008 at 8:43 PM, Dennis Lee Bieber <[EMA
On Thu, Dec 4, 2008 at 9:04 PM, Aaron Brady <[EMAIL PROTECTED]> wrote:
[... snip ...]
> Does the OP hold the following should be legal?
>
> if if or or:
> and( for )
> if not:
> while( def )
I most certainly hope not! :)
--JamesMills
--
--
-- "Problems are solved by method"
--
http://mail.py
I am going to be checking Amazon now and ordering the book.
Thanks
James
On Thu, Dec 4, 2008 at 9:42 PM, Alan G Isaac <[EMAIL PROTECTED]> wrote:
> Mark Summerfield wrote:
>
>> "Programming in Python 3:
>> A Complete Introduction to the Python Language"
>>
is has all been a figment of my
imagination...
http://www.pymolwiki.org/index.php/Covers
You forgot http://www.nature.com/neuro/journal/v10/n8/covers/index.html
James
--
http://mail.python.org/mailman/listinfo/python-list
I am going to have to agree with your colleague. I use Django a lot and you
are editing config.py and urls.py which are all python code.
On Thu, Dec 4, 2008 at 10:30 PM, Bruno Desthuilliers <
[EMAIL PROTECTED]> wrote:
> HT a écrit :
>
>> A colleague of mine is arguing that since it is easy to wri
tml', '05.html', '07.html', '02.html', '08.html']
>>> test
['03.html', '06.html', 'questions.html', '04.html', 'toc.html',
'01.html', '05.html', '07.html', '02.html', '08.html']
>>> from os.path import splitext
>>> files = [splitext(x)[0] for x in test]
>>> files
['03', '06', 'questions', '04', 'toc', '01', '05', '07', '02', '08']
>>>
And no, it's not a bug. Read the
docs :)
cheers
James
--
--
-- "Problems are solved by method"
--
http://mail.python.org/mailman/listinfo/python-list
Barry Warsaw wrote:
On behalf of the Python development team and the Python community, I am
happy to announce the release of Python 3.0 final.
comp.lang.python3k ?
--
http://mail.python.org/mailman/listinfo/python-list
ing'
I'm still using python 2.5.1.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
James Stroud wrote:
Hello All,
I subclassed dict and overrode __setitem__. When instances are
unpickled, the __setstate__ is not called before the keys are assigned
via __setitem__ in the unpickling protocol.
I googled a bit and found that this a bug filed in 2003:
http://bugs.python.org
Andreas Waldenburger wrote:
Is it me, or has c.l.p. developed a slightly harsher tone recently?
(Haven't been following for a while.)
Yep. I can only post here for about a week or two until someone blows a
cylinder and gets ugly because they interpreted something I said as a
criticism of the
erhaps it would
be helpful to provide a footnote at the bottom of all issue pages via
the page template that explains why they are not bugs and suggests a
general course of action for the programmer.
James
--
http://mail.python.org/mailman/listinfo/python-list
James Stroud wrote:
Terry Reedy wrote:
because there is no bug to fix. I have suggesting closing.
May I suggest to add something to this effect within the issue itself so
others won't spend time trying to figure out why the "bug" is still
open?
Sorry, you did that.
alex23 wrote:
On Dec 6, 8:00 am, James Stroud <[EMAIL PROTECTED]> wrote:
I think its a symptom of the language's
maturing, getting popular, and a minority fraction* of the language's
most devout advocates developing an egotism that complements their
python worship in a most unsa
#x27;s the interpreter going to do with our maverick's code?
James
--
http://mail.python.org/mailman/listinfo/python-list
Of course I meant
class C:
def me.method(arg):
me.value = arg
James
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
On Fri, 05 Dec 2008 20:35:07 -0800, James Stroud wrote:
Daniel Fetchinson wrote:
I'd like this new way of defining methods, what do you guys think?
Consider the maverick who insists on
class C:
def me.method(arg):
self.value = arg
Replace "
ing, "pretty" and "clever" will not be the words you are using. Trust
me on this one.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
al.
Caveat: the worksheets are built around Python 2.x (for small values of
x!), tell your friend not to use Python 3.0. This is one of the few cases
where it really matters that 'print' is now a function; nothing freaks a
beginner like his output not behaving the way he's been to
sing, or at
least not more than momentarily.
I'm -0 on this at the moment. Maybe -0.5. I don't really like the
potential for hideousness like
@staticmethod
def spam.alot(isa, silly, place):
return silly + spam
that's implied by making this a general feature of
macc_200 wrote:
Hi,
just starting programming and have an elementary question after
playing around with lists but cannot find the answer with googling.
I have a list of variables and I would like some of those variables to
be integers and some to be operators so the list would look something
l
unction matching no elements of the array. Some assignments are
made within the code simply to make it more readable. They are not
necessary. The first element that the truth function evaluates to True
is returned.
I hope it helps.
James
def linear_search(array, truth_func, loc=(0,0)):
James Stroud wrote:
def linear_search(array, truth_func, loc=(0,0)):
idx1, idx2 = loc
if idx1 >= len(array):
return None
if idx2 >= len(array[idx1]):
return linear_search(array, truth_func, (idx1+1, 0))
value = array[idx1][idx2]
tf = truth_func(value)
if tf:
retu
also check out matplotlib if you are into
heavyweight plotting and interactive application development.
James
--
http://mail.python.org/mailman/listinfo/python-list
of complex numbers: would 4 + 4i be equal to sqrt(32)?
Even in the realm of pure mathematics, the generality of objects (i.e.
numbers) can not be assumed.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http:
Luis Zarrabeitia wrote:
Quoting James Stroud <[EMAIL PROTECTED]>:
First, here is why the ability to throw an error is a feature:
class Apple(object):
def __init__(self, appleness):
self.appleness = appleness
def __cmp__(self, other):
assert isinstance(other, Apple),
vior should be for comparisons. I think the probability of
that happening is about zero, though, because such a change would run
counter to the dynamic nature of the language.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
James Stroud wrote:
[cast to bool] for numpy works like a unary ufunc.
Scratch that. Not thinking and typing at same time.
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo
On Sun, 07 Dec 2008 07:27:51 -, Lawrence D'Oliveiro
<[EMAIL PROTECTED]> wrote:
In message <[EMAIL PROTECTED]>, Rhodri
James wrote:
Yes, it's very pretty, and you're terribly clever. In six months' time
when you come back to make some engineering change a
python-list
The LiveWires Python Course, http://www.livewires.org.uk/python/home
is aimed at your son's age-group. There are several worksheets that
involve building games using a simple veneer over pygame, if you
need to entice him with something!
--
Rhodri James *-* Wildebeeste Herder to th
Steven D'Aprano wrote:
On Sun, 07 Dec 2008 13:57:54 -0800, James Stroud wrote:
Rasmus Fogh wrote:
ll1 = [y,1]
y in ll1
True
ll2 = [1,y]
y in ll2
Traceback (most recent call last):
File "", line 1, in
ValueError: The truth value of an array with more than one element is
Robert Kern wrote:
James Stroud wrote:
I'm missing how a.all() solves the problem Rasmus describes, namely
that the order of a python *list* affects the results of containment
tests by numpy.array. E.g. "y in ll1" and "y in ll2" evaluate to
different results in hi
2201 - 2300 of 3488 matches
Mail list logo