Re: Addition of multiprocessing ill-advised? (was: Python 3.0.1)

2009-01-27 Thread James Mills
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

Re: Python Application Server

2009-01-27 Thread James Mills
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

Re: Python Application Server

2009-01-27 Thread James Mills
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

Re: Addition of multiprocessing ill-advised? (was: Python 3.0.1)

2009-01-28 Thread James Mills
Jesse: Can I mail you off-list regarding multiprocessing ? cheers James -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list

Re: Function Application is not Currying

2009-01-28 Thread James Mills
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

Re: Exec woes

2009-01-28 Thread Rhodri James
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

Re: dicts,instances,containers, slotted instances, et cetera.

2009-01-29 Thread James Stroud
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

parsing text from a file

2009-01-29 Thread Wes James
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

Re: Exec woes

2009-01-29 Thread Rhodri James
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

Re: Does the Python community really follow the philospy of "Community Matters?"

2009-01-29 Thread James Mills
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

Re: Mathematica 7 compares to other languages

2009-01-30 Thread William James
[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) > >

Import Replacement

2009-01-31 Thread James Pruitt
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

Import Replacement

2009-01-31 Thread James Pruitt
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

Re: what IDE is the best to write python?

2009-02-01 Thread James Stroud
[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

Re: is python Object oriented??

2009-02-01 Thread Rhodri James
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

Re: Python package Management GUI - New Project on Sourceforge

2009-02-01 Thread James Mills
, 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

Re: Python package Management GUI - New Project on Sourceforge

2009-02-01 Thread James Mills
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

Re: Question about wx folder browser widget

2009-02-02 Thread Rhodri James
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

Re: is python Object oriented??

2009-02-02 Thread Rhodri James
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

Re: Reading text file with wierd file extension?

2009-02-02 Thread Rhodri James
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

Re: key capture

2009-02-02 Thread Rhodri James
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

Re: is python Object oriented??

2009-02-02 Thread Rhodri James
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

Re: is python Object oriented??

2009-02-03 Thread Rhodri James
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

Re: is python Object oriented??

2009-02-03 Thread Rhodri James
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

Re: is python Object oriented??

2009-02-03 Thread Rhodri James
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

Re: [Web 2.0] Added-value of frameworks?

2009-02-04 Thread James Matthews
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

Re: Use list name as string

2009-02-04 Thread Rhodri James
#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

Re: Feet and inches

2009-02-04 Thread Rhodri James
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

Re: Use list name as string

2009-02-04 Thread Rhodri James
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

Re: Is the subprocess module robust enough in 2.4?

2009-02-05 Thread James Mills
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

Re: global name 'sqrt' is not defined

2009-02-05 Thread James Mills
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

Re: where clause

2009-02-05 Thread Rhodri James
efinitely possible. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Use list name as string

2009-02-05 Thread Rhodri James
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

Re: return multiple objects

2009-02-05 Thread Rhodri James
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

Re: Using multiprocessing from a Windows service

2009-02-05 Thread James Mills
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

Re: Is c.l.py becoming less friendly?

2009-02-07 Thread James Stroud
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

Re: TkInter: Problem with propagation of resize events through geometry manager hierarchy?

2009-02-08 Thread James Stroud
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

Re: simple web app, where to start

2009-02-08 Thread James Matthews
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

Re: TkInter: Problem with propagation of resize events through geometry manager hierarchy?

2009-02-08 Thread James Stroud
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

Re: Scanning a file character by character

2009-02-10 Thread Rhodri James
() 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

Re: Propagating function calls

2009-02-10 Thread James Mills
+= Y() manager.send(Event(), "doThatFunkyFunk") cheers James [1] http://pypi.python.org/pypi/circuits/ -- http://mail.python.org/mailman/listinfo/python-list

Re: can multi-core improve single funciton?

2009-02-10 Thread James Mills
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

Re: re.sub and named groups

2009-02-11 Thread Rhodri James
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

Re: select.poll.poll() never blocks

2009-02-11 Thread Rhodri James
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

Re: Problem with objects copying each other in memory

2009-02-12 Thread Rhodri James
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

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-12 Thread Rhodri James
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://

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-12 Thread Rhodri James
. 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

Re: Scanning a file character by character

2009-02-12 Thread Rhodri James
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

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-13 Thread Rhodri James
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

Re: Rapidshare to Megaupload script

2009-02-14 Thread James Matthews
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

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-14 Thread Rhodri James
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

Re: Referencing resources from python

2009-02-16 Thread Rhodri James
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

Re: how to assert that method accepts specific types

2009-02-20 Thread Rhodri James
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

Re: reading file to list

2009-02-22 Thread William James
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

pickle.load() on an dictionary of dictionaries doesn't load full data structure on first call

2009-02-22 Thread James Pearson
'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

Re: pickle.load() on an dictionary of dictionaries doesn't load full data structure on first call

2009-02-22 Thread James Pearson
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

Re: Exhaustive Unit Testing

2008-11-30 Thread James Harris
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

Re: HELP!...Google SketchUp needs a Python API

2008-12-01 Thread James Mills
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

Re: Running a Python script from crontab

2008-12-02 Thread James Mills
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,

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread James Mills
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.

Re: How to sort a list of file paths

2008-12-02 Thread James Mills
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

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread James Mills
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

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread James Mills
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'

Re: generating a liste of characters

2008-12-03 Thread James Mills
scii_letters, digits >>> chars = ascii_letters + digits >>> chars 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' >>> cheers James -- -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't you just love writing this sort of thing :)

2008-12-03 Thread James Mills
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

Re: RELEASED Python 3.0 final

2008-12-03 Thread James Mills
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

Re: How can I do this (from Perl) in Python? (closures)

2008-12-04 Thread James Stroud
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

Re: "as" keyword woes

2008-12-04 Thread James Stroud
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 -

Re: Pythonic design patterns

2008-12-04 Thread James Stroud
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

Re: "as" keyword woes

2008-12-04 Thread James Mills
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

Re: "as" keyword woes

2008-12-04 Thread James Mills
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

Re: ANN: New Book: Programming in Python 3

2008-12-04 Thread James Matthews
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" >>

Re: To Troll or Not To Troll

2008-12-04 Thread James Stroud
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

Re: Why shouldn't you put config options in py files

2008-12-04 Thread James Matthews
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

Re: pretty strange behavior of "strip"

2008-12-04 Thread James Mills
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

Re: RELEASED Python 3.0 final

2008-12-04 Thread James Stroud
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

dict subclass and pickle bug (?)

2008-12-05 Thread James Stroud
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

Re: dict subclass and pickle bug (?)

2008-12-05 Thread James Stroud
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

Re: To Troll or Not To Troll (aka: "as" keyword woes)

2008-12-05 Thread James Stroud
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

Re: dict subclass and pickle bug (?)

2008-12-05 Thread James Stroud
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

Re: dict subclass and pickle bug (?)

2008-12-05 Thread James Stroud
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.

Re: To Troll or Not To Troll (aka: "as" keyword woes)

2008-12-05 Thread James Stroud
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

Re: Guido's new method definition idea

2008-12-05 Thread James Stroud
#x27;s the interpreter going to do with our maverick's code? James -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido's new method definition idea

2008-12-05 Thread James Stroud
Of course I meant class C: def me.method(arg): me.value = arg James -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido's new method definition idea

2008-12-06 Thread James Stroud
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 "

Re: Don't you just love writing this sort of thing :)

2008-12-06 Thread Rhodri James
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

Re: python book for non technical absolute beginner

2008-12-06 Thread Rhodri James
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

Re: Guido's new method definition idea

2008-12-06 Thread Rhodri James
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

Re: operators as variables

2008-12-06 Thread James Stroud
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

Re: Brain going crazy with recursive functions

2008-12-07 Thread James Stroud
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)):

Re: Brain going crazy with recursive functions

2008-12-07 Thread James Stroud
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

Re: can graphs be made in python as we make in java

2008-12-07 Thread James Stroud
also check out matplotlib if you are into heavyweight plotting and interactive application development. James -- http://mail.python.org/mailman/listinfo/python-list

Re: Rich Comparisons Gotcha

2008-12-07 Thread James Stroud
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:

Re: Rich Comparisons Gotcha

2008-12-07 Thread James Stroud
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),

Re: Rich Comparisons Gotcha

2008-12-07 Thread James Stroud
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

Re: Rich Comparisons Gotcha

2008-12-07 Thread James Stroud
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

Re: Don't you just love writing this sort of thing :)

2008-12-07 Thread Rhodri James
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

Re: Python for kids?

2008-12-07 Thread Rhodri James
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

Re: Rich Comparisons Gotcha

2008-12-07 Thread James Stroud
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

Re: Rich Comparisons Gotcha

2008-12-07 Thread James Stroud
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

<    18   19   20   21   22   23   24   25   26   27   >