Re: A Moronicity of Guido van Rossum

2005-09-29 Thread Shane Hathaway
Delaney, Timothy (Tim) wrote: > You have to admit though, he's remarkably good at getting past > Spambayes. Despite classifying *every* Xah Lee post as spam, he still > manages to get most of his posts classified as 0% or 1% spam. Hmm, perhaps he's using steganography. Maybe the emails actually

How to get listed on planet.python.org

2005-10-17 Thread Shane Hathaway
I've been writing Python-related articles on my weblog, and I thought planet.python.org might be interested in including them. Does anyone know how to submit a feed to the aggregator? http://hathawaymix.org/Weblog/rss20.xml?categories:list=Python Shane -- http://mail.python.org/mailman/listin

Re: PythonMagick on Windows

2005-12-05 Thread Shane Hathaway
Adam Endicott wrote: > Claudio Grondi wrote: > >>Why is PIL *(Python Image Library) not suitable to do the graphics? >> >>http://www.pythonware.com/products/pil/ >> >>Claudio > > > I am using PIL for some other things, but what I need ImageMagick for > is to convert a PDF into a series of jpegs

Proposal: Inline Import

2005-12-09 Thread Shane Hathaway
Here's a heretical idea. I'd like a way to import modules at the point where I need the functionality, rather than remember to import ahead of time. This might eliminate a step in my coding process. Currently, my process is I change code and later scan my changes to make matching changes to t

Re: Proposal: Inline Import

2005-12-09 Thread Shane Hathaway
Benji York wrote: > Why not: 1) jump to the top of the file when you need to do an import > (1G in Vim), 2) add the import, 3) jump back to where you were (Ctrl-o > in Vim) and keep coding. This isn't Vim specific, I suspect all decent > editors have similar capabilities (I know Emacs does). T

Re: Proposal: Inline Import

2005-12-09 Thread Shane Hathaway
Benji York wrote: > OK, good. You won't have to worry about that. :) You didn't give a reason for disliking it. Shane -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal: Inline Import

2005-12-09 Thread Shane Hathaway
Xavier Morel wrote: > Shane Hathaway wrote: > >>Thoughts? > > > >>> import re; name_expr = re.compile('[a-zA-Z]+') > >>> name_expr > <_sre.SRE_Pattern object at 0x00F9D338> > >>> > > the import statement can be

Re: Proposal: Inline Import

2005-12-09 Thread Shane Hathaway
Mike Meyer wrote: > Shane Hathaway <[EMAIL PROTECTED]> writes: >>I'd like a way to import modules at the point where I need the >>functionality, rather than remember to import ahead of time. This >>might eliminate a step in my coding process. Currently, my proc

Re: Proposal: Inline Import

2005-12-09 Thread Shane Hathaway
Mike Meyer wrote: > Shane Hathaway <[EMAIL PROTECTED]> writes: >>That syntax is verbose and avoided by most coders because of the speed >>penalty. > > > What speed penalty? "import re" is a cheap operation, every time but > the first one in a program.

Re: Proposal: Inline Import

2005-12-10 Thread Shane Hathaway
Kent Johnson wrote: > Shane Hathaway wrote: >>I'm talking about using imports *everywhere*. The penalty would be >>appreciable. > > > Have you tried it? > > D:\Projects\CB>python -m timeit -s "import re" "import re" > 100 loops,

Managing import statements

2005-12-10 Thread Shane Hathaway
Let's talk about the problem I really want help with. I brought up a proposal earlier, but it was only half serious. I realize Python is too sacred to accept such a heretical change. ;-) Here's the real problem: maintaining import statements when moving sizable blocks of code between modules

Re: Proposal: Inline Import

2005-12-10 Thread Shane Hathaway
Steve Holden wrote: > Shane Hathaway wrote: >> The structure of the Java language makes this relatively easy. >> > > And there's so much more busywork in Java that it's probably worth > automating. See > >http://www.artima.com/weblogs/viewpost.jsp?

Re: Managing import statements

2005-12-10 Thread Shane Hathaway
Jean-Paul Calderone wrote: > On Sat, 10 Dec 2005 02:21:39 -0700, Shane Hathaway <[EMAIL PROTECTED]> wrote: >>How about PyLint / PyChecker? Can I configure one of them to tell me >>only about missing / extra imports? Last time I used one of those >>tools, it spewed ex

Re: Managing import statements

2005-12-10 Thread Shane Hathaway
Chris Mellon wrote: > On 12/10/05, Shane Hathaway <[EMAIL PROTECTED]> wrote: >>I'm surprised this problem isn't more familiar to the group. Perhaps >>some thought I was asking a newbie question. I'm definitely a newbie in >>the sum of human knowledge, bu

Re: Loop until condition is true

2005-06-21 Thread Shane Hathaway
Remi Villatel wrote: > Hi there, > > There is always a "nice" way to do things in Python but this time I can't > find one. > > What I'm trying to achieve is a conditionnal loop of which the condition > test would be done at the end so the loop is executed at least once. It's > some way the opp

Re: timeoutsocket.py mirror?

2005-07-13 Thread Shane Hathaway
[EMAIL PROTECTED] wrote: > Can anybody provide a mirror for this module? The original URL seems to > be down. I have been looking for over an hour, and every single > resource that uses it links to the timo-tasi.org site to download it. FWIW, Python 2.3+ has the timeout functionality built in, so

Re: time.clock() or time.time()

2005-08-02 Thread Shane Hathaway
[EMAIL PROTECTED] wrote: > What's the difference between time.clock() and time.time() > (and please don't say clock() is the CPU clock and time() is the actual > time because that doesn't help me at all :) > > I'm trying to benchmark some function calls for Zope project and when I > use t0=time.cl

Re: time.clock() or time.time()

2005-08-03 Thread Shane Hathaway
Magnus Lycka wrote: > Shane Hathaway wrote: > >>time.time() measures real time, while time.clock() measures the time the >>CPU dedicates to your program. > > > I suppose that varies with the platform... "help(time.clock)" says: > >

urllib versus IIS

2005-03-22 Thread Shane Hathaway
I started experimenting with SOAPpy yesterday and immediately hit a snag. Both web services I tried simply hung and never replied. After a lot of digging, I found out what was going wrong: urllib.urlopen() is issuing an HTTP/1.0 request, but Microsoft IIS 5 ignores the client HTTP version and

Re: pre-PEP: Suite-Based Keywords

2005-04-16 Thread Shane Hathaway
Kent Johnson wrote: > Brian Sabbey wrote: >> Using suite-based keyword arguments, the code >> >> f(x = 1) >> >> is equivalent to >> >> f(): >>x = 1 > > > ISTM the syntax is ambiguous. How do you interpret > if f(): > x = 1 > ? > > Is a suite alllowed only when a block could not be introduc

Re: pre-PEP: Suite-Based Keywords

2005-04-17 Thread Shane Hathaway
Brian Sabbey wrote: > Maybe using '**' would be better than '...' since it already is used to > indicate keyword arguments. Example: > > class C(object): > x = property(**): >doc = "I'm the 'x' property." >def fget(self): > return self.__x >def fset(self, val

Re: PyGTK vs. wxPython

2005-04-27 Thread Shane Hathaway
Szabolcs Nagy wrote: > it's not quite true since the latest stable release (2.6.0.0) > > see the new wx doc (it's generated with epydoc so it's not for C++): > http://www.wxpython.org/docs/api/ > > i used wxPython with XRCed a few times and i liked the way it works > (worked under linux and win a

Re: Trigraph Idiom - Original?

2005-04-27 Thread Shane Hathaway
Jeff Winkler wrote: > I've come up with a trigraph idiom, am curious if it's been done before > (probably). I like to use trigraphs occasionally. > > Scenario: I'm doing an RSS->Javascript conversion for our intranet. I'd > like to use different CSS class if a post is new. Code: > > hoursOld=abs(

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-29 Thread Shane Hathaway
pythonchallenge wrote: > For the riddles' lovers among you, you are most invited to take part > in the Python Challenge, the first python programming riddle on the net. > > You are invited to take part in it at: > http://www.pythonchallenge.com That was pretty fun. Good for a Friday. Too bad it

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-29 Thread Shane Hathaway
darren kirby wrote: > quoth the Shane Hathaway: > >>pythonchallenge wrote: >> >>>For the riddles' lovers among you, you are most invited to take part >>>in the Python Challenge, the first python programming riddle on the net. >>>

Re: Proposal: Inline Import

2005-12-10 Thread Shane Hathaway
Benji York wrote: > Shane Hathaway wrote: > >> Benji York wrote: >> >>> OK, good. You won't have to worry about that. :) >> >> >> You didn't give a reason for disliking it. > > > Oh, I don't particularly dislike it.

Re: python coding contest

2005-12-27 Thread Shane Hathaway
Paul McGuire wrote: > "Paul McGuire" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > >>Well *I'm* certainly looking forward to learning some new tricks! My >>(non-cheat) version is a comparatively-portly 245, and no alternatives are >>popping into my head at the moment! >> >>--

Re: python coding contest

2005-12-27 Thread Shane Hathaway
Tim Hochberg wrote: > Paul McGuire wrote: > >>"Shane Hathaway" <[EMAIL PROTECTED]> wrote in message >>news:[EMAIL PROTECTED] >> >> >>>I'm down to 133 characters (counted according to 'wc -c') on a single >>>line.

Re: python coding contest

2005-12-28 Thread Shane Hathaway
I just found a 125 character solution. It's actually faster and more readable than the 133 character solution (though it's still obscure.) It depends on Python 2.4. If Python 2.3 compatibility is required for the contest, I have to add 4 characters. Shane [EMAIL PROTECTED] pycontest_01]$ wc

Re: python coding contest

2005-12-29 Thread Shane Hathaway
Andrew Durdin wrote: > On 12/28/05, Shane Hathaway <[EMAIL PROTECTED]> wrote: > >>I just found a 125 character solution. It's actually faster and more >>readable than the 133 character solution (though it's still obscure.) > > > Having spent a go

Re: python coding contest

2005-12-30 Thread Shane Hathaway
Tim Hochberg wrote: > g=''.join;seven_seg=lambda i:g( > g(' _|x|'[ord("~$]m'k{d\x7fo"[int(n)])>>s&j] > for n in i for j in(2,1,4))+'\n'for s in(6,0,3)) > > I've replaced the unprintable characters and added some preemptive > linebreaks so that hopefully this won't get too munged. It's all clear

Re: python coding contest

2005-12-30 Thread Shane Hathaway
Szabolcs Nagy wrote: > my two solutions (well I wasn't so clever to encode everything in > strings instead of numbers, but at least it won't give warnings about > non ascii characters): > 128: > j,seven_seg=''.join,lambda s:j(j(' |_ |'[i>>3*int(c)&b]for c in s for b > in(4,2,1))+'\n'for i in(306775

Re: python coding contest

2005-12-30 Thread Shane Hathaway
André wrote: > For the few that might be interested, I will be posting the details of > a 117 character long solution to the challenge on my blog > http://aroberge.blogspot.com/. > > Enjoy! You took advantage of prime numbers, enabling you to extract encoded information using a single modulus op

Re: python coding contest

2005-12-30 Thread Shane Hathaway
Claudio Grondi wrote: > so I tried all which made sense in the context of '0' conversion and > found out, that it should be the > >' _ |_|_ _| |' > > not the at http://aroberge.blogspot.com/ > >' _ |_|_ _| |' The HTML source has the three spaces. If the code had been surrounded by

Re: Spiritual Programming (OT, but Python-inspired)

2006-01-03 Thread Shane Hathaway
[EMAIL PROTECTED] wrote: > Perhaps this is one reason why programmers are so passionate, and even > religious, about their programming tools; because they intuitively > sense that we are dealing with ideas that, however crudely, mirror > eternal realities of immense significance. While I don't ass

Re: libpython2.4.so

2006-01-06 Thread Shane Hathaway
Levi Campbell wrote: > what is /usr/lib/libpython2.4.so used for? > On many systems, it is the core of Python, and /usr/bin/python2.4 is a small wrapper around it. Here's what I see on my box: [EMAIL PROTECTED] usr]$ ls -l bin/python2.4 lib/libpython2.4.so.1.0 -rwxr-xr-x 1 root root4072 O

Re: Finding the name of a class

2006-08-01 Thread Shane Hathaway
John Salerno wrote: > >>> class Foo(object): > pass > > >>> dir(Foo) > ['__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__', > '__hash__', '__init__', '__module__', '__new__', '__reduce__', > '__reduce_ex__', '__repr__', '__setattr__', '__str__', '__weakref__'] > > Hmm

Re: Finding the name of a class

2006-08-03 Thread Shane Hathaway
John Salerno wrote: > Shane Hathaway wrote: > >> Don't forget to file a bug. > > I'm reluctant to call it a bug just yet. Here's more stuff below. > There's obviously a difference between old- and new-style classes. It > seems that as far as new-sty

Re: OT: What's up with the starship?

2006-10-16 Thread Shane Hathaway
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > >> Then perhaps you or he could explain it to us less intelligent >> people in very simple terms? > > the security advisory explains that the cause of the problem is a bug > in the source code used to implement repr() for 32-bit Unicode strings,

Re: OT: What's up with the starship?

2006-10-16 Thread Shane Hathaway
Fredrik Lundh wrote: > Shane Hathaway wrote: > > > I don't know if this concern applies to Starship specifically, but it > > seems to apply to thousands of web sites running Python CGIs and > > Python web servers. > > so are we seeing thousands of we

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-07 Thread Shane Hathaway
robert wrote: > I'd like to use multiple CPU cores for selected time consuming Python > computations (incl. numpy/scipy) in a frictionless manner. > > Interprocess communication is tedious and out of question, so I > thought about simply using a more Python interpreter instances > (Py_NewInterpret

Re: Web Browser Pygame Plug-in?

2006-07-07 Thread Shane Hathaway
Gregory Piñero wrote: > Are there security issues too? Would you remove potentially harmful > Python libraries for the plugin, not allow system calls, etc? Would > you only allow file system access in one area? Ah, so you also want to distribute untrusted Python code. That's fairly hard. There

Re: Out of the box database support

2006-07-07 Thread Shane Hathaway
Alex Biddle wrote: > Ah, so separate downloads then. At least now I know. > > Ergh... I checked the version of Python my current host is running and its > 2.2. > > ...ergh This is why you really want a VPS (virtual private server). The cost is similar to a web host but you get to choose yo

Re: Web Browser Pygame Plug-in?

2006-07-07 Thread Shane Hathaway
Gregory Piñero wrote: > I was just idley curious on what it would take to make a web plug-in > for Pygame. I'm picturing it working the way my browser currently > shows flash games. Is such an idea even possible? Has anyone > attempted this? I once played with a similar idea. Yes, it's possibl

Re: Out of the box database support

2006-07-07 Thread Shane Hathaway
Alex Biddle wrote: > Ah, so separate downloads then. At least now I know. > > Ergh... I checked the version of Python my current host is running and its > 2.2. > > ...ergh This is why you really want a VPS (virtual private server). The cost is similar to a web host but you get to choose yo

Re: Out of the box database support

2006-07-08 Thread Shane Hathaway
Alex Biddle wrote: > Ah, so separate downloads then. At least now I know. > > Ergh... I checked the version of Python my current host is running and its > 2.2. > > ...ergh This is why you really want a VPS (virtual private server). The cost is similar to a web host but you get to choose y

Re: Web Browser Pygame Plug-in?

2006-07-09 Thread Shane Hathaway
Gregory Piñero wrote: > Shane Wrote: >> Ah, so you also want to distribute untrusted Python code. That's fairly >> hard. There's a discussion about it on Python-Dev right now. > > Well, I want to write a game in Pygame, and people can just go to my > website and play it within their browser. I

Re: The Python Papers Edition One

2006-11-24 Thread Shane Hathaway
[EMAIL PROTECTED] wrote: > Ben Finney wrote: >> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: >> >>> Yes, it's true that you can't resell copies of The Python Papers for >>> personal profits, but you may derive from it, reproduce and >>> propagate it. You're quite right to point it out. >> Then p

Re: Subprocess with a Python Session?

2006-12-05 Thread Shane Hathaway
Calvin Spealman wrote: > No matter what I do I cant get the following code to do what I expect. > I hadn't used subprocess t o read and write to pipes of a > still-running app, and I just can't seem to get it right. What gives? > > import subprocess > > p = subprocess.Popen("python", stdout=subpr

Re: first release of PyPy

2005-05-21 Thread Shane Hathaway
Torsten Bronger wrote: > Hallöchen! > > "Kay Schluehr" <[EMAIL PROTECTED]> writes: > > >>[...] >> >>[...] Once You get enough speed out of the PyPy-runtime and the >>community shifts to it the PEP-process degenerates in the view of >>a PyPythonista to discussions about aspects of the std-objects

Re: first release of PyPy

2005-05-23 Thread Shane Hathaway
Mike Meyer wrote: > Basically, there's a *lot* of history in programming languages. I'd > hate to see someone think that we went straight from assembler to C, > or that people didn't understand the value of dynamic languages very > early. Yes, although I wasn't following historical events; I was f

Re: Python analog of Ruby on Rails?

2005-05-26 Thread Shane Hathaway
George Sakkis wrote: > "Christopher J. Bottaro" wrote: > > >>Cool signature, can anyone do a Python one that I can leech? =) >> >>-- C >> > > > Here's the transliteration in python for your address: > > python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) > for p

Re: Running a python program during idle time only

2005-05-27 Thread Shane Hathaway
Mike Meyer wrote: > On a completely different topic, this looks like the wrong way to solve > the problem. You want to update a search engine based on changes to the > underlying file system. The right way to do this isn't to just keep > rescanning the file system, it's to arrange things so that yo

Re: working with pointers

2005-05-31 Thread Shane Hathaway
Michael wrote: > sorry, I'm used to working in c++ :-p > > if i do > a=2 > b=a > b=0 > then a is still 2!? > > so when do = mean a reference to the same object and when does it mean make > a copy of the object?? To understand this in C++ terms, you have to treat everything, including simple inte

Re: anygui,anydb, any opinions?

2005-05-31 Thread Shane Hathaway
rzed wrote: > That's all I'm talking about here. To be able to write a Python > application that can ultimately be displayed using wxWidgets or Qt > or Tkinter or Curses. Then, without having to do more than to > change which interface package is imported, to expect to see the > result displaye

Re: wtf

2007-04-26 Thread Shane Hathaway
Sergiy wrote: > print 1 / 2 > print -1 / 2 > > 0 > -1 > > correct? Yes. It works like the floor() function. >>> import math >>> math.floor(1.0 / 2) 0.0 >>> math.floor(-1.0 / 2) -1.0 Shane -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.5 licensing: stop this change

2006-04-01 Thread Shane Hathaway
Steve Holden wrote: > As the only director of the Python Software Foundation to vote against a > recent Board motion to implement the change in licensing terms described in > >http://pyfound.blogspot.com/2006/04/python-25-licensing-change.html I must saay that i am fully in favor of this cha