A comp.lang.python code snippet archive?

Hans Nowak hnowak at cuci.nl
Thu Mar 2 17:50:15 EST 2000


On 2 Mar 00, at 8:38, chris patti wrote:

> "Hans Nowak" <hnowak at cuci.nl> writes:
> 
> > On 28 Feb 00, at 19:44, Michael Hudson wrote:
> > 
> > [snippets site questions]
> > > > I would like to know:
> > > > * if it's still worthwile to continue this site
> > > > * what kind of improvements I could make (a search engine would be
> > > > cool but I don't know much about CGI)
> > > > 
> > > > Ideas, anyone?
> > > 
> > > I'd think it was worth continuing.  I'd also think it could be made
> > > easier, however - I use gnus to read my mail, and I'd be damned if
> > > it wasn't possible to rig things so that I could go 'M-x snippet'
> > > when I was reading a suitable article and have it appear in the
> > > archive.
> > 
> > Yes, but almost every snippet is edited before it is added... if only
> > to add some headers. But I also like to test snippets if possible,
> > before they are actually uploaded. So automating this process won't be
> > easy. I intend it to be more than just an archive of messages with
> > code.
> 
> Hi Michael thanks for chiming in..
> 
> I think your website is _definitely_ worth continuing - I just think
> more people need to get actively involved in testing and submitting
> snippets.  I can think of several recent posts that, if I still have
> them in my spool would make great snippets (the memoization and tail
> recursion posts come to mind) if I can find time I'll grab them, test
> them, maybe figure out what your criteria for submission are and start
> submitting the 'best of' c.l.p to your archive.

Hmm... I will *try* to scan the whole slew of messages anyway, so maybe
there will be double work done. It may be a better idea, for anyone who
wants to help, to submit snippets which are found on other places... sites
maybe, home-made code, etc. Also, I notice that some topics have a lot
more snippets than others. Tuples for instance are often used, but only
spawned one snippet so far. Maybe someone would like to look into these
"under- appreciated" topics and try to find or write some cool Python
tidbits for them.

> I think as a separate issue, the automated extraction of any/all code
> snippets posted on the newsgroup/mailing list would be a useful thing to
> have readily accessible on a website somewhere - that way nothing's lost
> in the tide of zillions of new news articles coming every day..
> 
> I wonder if I could key off the use of 'import' ?  I suppose there are
> useful snippets that don't use import, though.

I was thinking that the # character might be significant, too... it is not
often used in normal text, but often (although not always) in Python. This
method could turn out to be not too unreliable.

> I wonder what I could use (algorithmically) to find arbitrary Python
> code embedded in a blob of text?
> 
> -Chris
> (I do have some web space at my disposal - if I could write the
> 'grabber' I could subscribe to python-list and have procmail invoke it
> or somesuch..) --

I think I'll try the # method first, before anyone gets too much work
done... It may be sufficient.

--Hans Nowak (zephyrfalcon at hvision.nl)
Homepage: http://fly.to/zephyrfalcon
You call me a masterless man. You are wrong. I am my own master.




More information about the Python-list mailing list