Re: Is Python Right for Me?

2007-02-03 Thread Stuart D. Gathman
/ http://www.livewires.org.uk/python/pdfsheets.html As an adult, just skip rapidly through the elementary material. The final module (Games sheets) walks you through creating 3 2D games with pygame! -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Ph

Re: Vim scripting with python

2007-02-03 Thread Stuart D. Gathman
unction() > python << EOF > import vim, string > ...blablabla > EOF > endfunction > > but I would like to use external ".py" files. :py import myfile Use :py inside your vimrc - don't run python externally. -- Stuart D. Gathman <[EMAIL PR

Re: Debugging SocketServer.ThreadingTCPServer

2007-02-03 Thread Stuart D. Gathman
On Tue, 16 Jan 2007 09:11:38 -0500, Jean-Paul Calderone wrote: > On Tue, 16 Jan 2007 00:23:35 -0500, "Stuart D. Gathman" > <[EMAIL PROTECTED]> wrote: >>I have a ThreadingTCPServer application (pygossip, part of >>http://sourceforge.net/projects/pymilter). It mo

doctest problem with null byte

2007-01-25 Thread Stuart D. Gathman
on raised: Traceback (most recent call last): File "/var/tmp/python2.4-2.4.4c1-root/usr/lib/python2.4/doctest.py", line 1248, in __run compileflags, 1) in test.globs TypeError: compile() expected string without null bytes *

Re: Best way to document Python code...

2007-01-22 Thread Stuart D. Gathman
On Mon, 22 Jan 2007 17:35:18 -0500, Stuart D. Gathman wrote: > The HTML generated by pydoc doesn't link to standard modules properly. > They are generated as relative links. So it can't be used without > modification for generating docs for a web page about a python

Re: Best way to document Python code...

2007-01-22 Thread Stuart D. Gathman
about a python package. I'm struggling with the same issue. Coding Python is so much easier than Java. However documenting Java is so much easier than Python. Just include doc comments, run javadoc, and voila! -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management

Debugging SocketServer.ThreadingTCPServer

2007-01-15 Thread Stuart D. Gathman
get a thread dump? If needed, I can import pdb and set options at startup, but there needs to be some external way of triggering the dump since I can't reproduce it at will. -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 F

Re: I'm looking for a pythonic red-black tree...

2006-12-16 Thread Stuart D. Gathman
d seriously consider trying to modify Python to replace the built-in dict with a skip-list algorithm and compare the performance. Failing that, an extension module implementing a sorted container of some description would be useful. -- Stuart D. Gathman <[EMAIL PROTECTED]> B

Package vs. module

2006-12-16 Thread Stuart D. Gathman
etpass 2) package that cannot be run directly from command line 3) single file module with associated driver package is the most pythonic? -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledi

Re: Automatic debugging of copy by reference errors?

2006-12-09 Thread Stuart D. Gathman
r than copied. I'm not sure it's worth turning python into fortran - even for selected namespaces. -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledictis, flamis acribus addictis&qu

Re: Driver selection

2006-12-09 Thread Stuart D. Gathman
On Fri, 08 Dec 2006 21:35:41 -0800, Gabriel Genellina wrote: > On 9 dic, 00:53, "Stuart D. Gathman" <[EMAIL PROTECTED]> wrote: >> Or you can modify the source to "from drivermodule import DNSLookup". >> >> What is the friendliest way to make this c

Driver selection

2006-12-08 Thread Stuart D. Gathman
r run time. -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledictis, flamis acribus addictis" - background song for a Microsoft sponsored "Where do you want to go from here?" commercial.

Re: NFS server

2006-11-27 Thread Stuart D. Gathman
, apparently python was used for quickly building test rigs while developing NFS v4. Having a framework for python NFS server could be useful - think custom filesystem. Although a python binding for fuse + C NFS server would be more general (use locally as well as remotely). -- Stua

Re: smtplib timeout

2006-07-25 Thread Stuart D. Gathman
On Tue, 25 Jul 2006 09:21:40 -0700, Alan Kennedy wrote: > [Stuart D. Gathman] >> I need to set a timelimit for the operation of >> smtplib.sendmail. It has to be thread based, because pymilter uses >> libmilter which is thread based. > > Have you tried setting a de

smtplib timeout

2006-07-25 Thread Stuart D. Gathman
nice timeout exception, the thread running the function continues to run. In fact, the problem is worse, because even more threads are created. -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis ma

Re: Help beautify ugly heuristic code

2006-07-24 Thread Stuart D. Gathman
uld it handle ip bytes that are the same: 1.2.2.2 Mitja has proposed a scoring system reminiscent of SpamAssassin. This gives me a few things to try. -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Conf

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Stuart D. Gathman
al iterator */ for (_idx = 0; _idx < NLST; ++_idx) { int *i = lst[_idx]; if (*i == *_i2) i = &_i4; } for (_idx = 0; _idx < NLST; ++_idx) printf("%d\n",*lst[_idx]); -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc.

Re: inline function call

2006-01-04 Thread Stuart D. Gathman
to specialize only those functions that need it after profiling your application. -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledictis, flamis acribus addictis" - background song for a Microsoft

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

2006-01-03 Thread Stuart D. Gathman
On Mon, 02 Jan 2006 19:05:04 -0500, Steven D'Aprano wrote: > I don't dare ask where your evidence for this hypothesis is, but I will > ask what are your reasons for imagining this? What is the chain of > thought that leads from: > > Step 1: We live in a temporal world. > > to: > > Step N: Our

Re: sorting with expensive compares?

2005-12-28 Thread Stuart D. Gathman
lision pairs of MP3 files where one member carries a freely redistributable license, and the other a "copy this and we'll sue your ass off" license in an effort to trap the unwary. -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 5

Re: Help beautify ugly heuristic code

2004-12-10 Thread Stuart D. Gathman
On Fri, 10 Dec 2004 22:03:20 +, JanC wrote: > Stuart D. Gathman schreef: > >> I have a function that recognizes PTR records for dynamic IPs. There > Did you also think about ISPs that use such a PTR record for both dynamic > and fixed IPs? There seems to be a lot o

Re: Help beautify ugly heuristic code

2004-12-10 Thread Stuart D. Gathman
That gives me a few things to try. -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledictis, flamis acribus addictis" - background song for a Microsoft sponsored "Where do you want t

Re: Creating Fixed Length Records

2004-12-08 Thread Stuart D. Gathman
x27;8s6s2s' >>> v = ('foo','bar','AA') >>> struct.pack(fmt,*v) 'foo\x00\x00\x00\x00\x00bar\x00\x00\x00AA' -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-

Re: Help beautify ugly heuristic code

2004-12-08 Thread Stuart D. Gathman
On Wed, 08 Dec 2004 19:52:53 -0500, Lonnie Princehouse wrote: > I don't think a Bayesian classifier is going to be very helpful here, > unless you have tens of thousands of examples to feed it, or unless it We do have tens of thousands of examples to feed it. > The series of if host.find(...) li

Re: Help beautify ugly heuristic code

2004-12-08 Thread Stuart D. Gathman
On Wed, 08 Dec 2004 18:39:15 -0500, Lonnie Princehouse wrote: > Regular expressions. > > It takes a while to craft the expressions, but this will be more > elegant, more extensible, and considerably faster to compute (matching > compiled re's is fast). I'm already doing that with the rehmac rege

Re: Help beautify ugly heuristic code

2004-12-08 Thread Stuart D. Gathman
On Wed, 08 Dec 2004 18:00:06 -0500, Mitja wrote: > On Wed, 08 Dec 2004 16:09:43 -0500, Stuart D. Gathman <[EMAIL PROTECTED]> > wrote: > >> I have a function that recognizes PTR records for dynamic IPs Here >> is the very ugly code so far. >> ... >

Help beautify ugly heuristic code

2004-12-08 Thread Stuart D. Gathman
I have a function that recognizes PTR records for dynamic IPs. There is no hard and fast rule for this - every ISP does it differently, and may change their policy at any time, and use different conventions in different places. Nevertheless, it is useful to apply stricter authentication standards