Oneliners? 
Author Message
 Oneliners?

Hi all

Before anything else, I *do not* want to start a
my-language-is-better-than-yours-kind-of-thread here,
so please don't give me the reasons why I should use
this language over that and so on.
I'm only interrested in pure facts :-)

And now for...the question:
I looked at the "Cryptographic Curiosities" at
http://www.*-*-*.com/
about short python crypto-scripts.

Are there other examples of scripts that do a lot of cool stuff
in one or just a few lines?
(here comes the not-an-intended-flame-bait stuff :-)

I heard there was a webserver in one line of Perl,
does Python match that (or two or three...)?

Of course, the length of code is not my primary criteria
in choise of language, but it's rather cool in a geeky kind of way,
don't you think?

I've-been-told-the-size-doesn't-matter-ly y'rs
 -- Thomas



Mon, 31 Dec 2001 03:00:00 GMT  
 Oneliners?

Quote:
> I heard there was a webserver in one line of Perl,
> does Python match that (or two or three...)?

how about:

    from asyncHTTPServer import *; HTTPServer(80, FileSource("/web")); mainloop()

(one line, three statements)

writing the asyncHTTPServer module is left as an exercise
(or you can wait for my Python/Tkinter book...)

</F>



Mon, 31 Dec 2001 03:00:00 GMT  
 Oneliners?

Quote:

> I heard there was a webserver in one line of Perl,
> does Python match that (or two or three...)?

Shouldn't be too hard, if you count:

import SimpleHTTPServer

as only one line!

--
Tim Evans



Tue, 01 Jan 2002 03:00:00 GMT  
 Oneliners?

Quote:
> Shouldn't be too hard, if you count:

> import SimpleHTTPServer

> as only one line!

better make that:

import SimpleHTTPServer; SimpleHTTPServer.test()

(don't ask why, but that server produced something
that caused my browser to completely lose it...)

</F>



Tue, 01 Jan 2002 03:00:00 GMT  
 Oneliners?
Dear Fredrik,
I am doing some python UI work
and am in *desparate* need of a good reference
on python/tkinter. Would it be possible for me
to gain access to a preprint of what you have
finished so far on your book?

I already have a copy on order with fatbrain,
but as usually, all projects must be done in "internet" time.

I work at E Ink corporation, developing a new kind of
electronic display, and of course I use python wherever
possible in building UI and utilities for entering in information
to be displayed in our signs.

I'd be willing to send you my feedback, and I'd be eternally greatful.

    Thank in advance,
    pehr anderson

    www.nbxcorp.com '96
    MIT '97
    www.media.mit.edu '98
    www.eink.com '99

Quote:


> > I heard there was a webserver in one line of Perl,
> > does Python match that (or two or three...)?

> how about:

>     from asyncHTTPServer import *; HTTPServer(80, FileSource("/web")); mainloop()

> (one line, three statements)

> writing the asyncHTTPServer module is left as an exercise
> (or you can wait for my Python/Tkinter book...)

> </F>



Mon, 21 Jan 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. LOGO-L> oneliners and home in mswlogo

2. -e oneliners with File.open

3. Obfuscated oneliner

4. APL oneliners, ASCII & ?

 

 
Powered by phpBB® Forum Software