selfrepr.py for your amusement ;-)

Magnus Lie Hetland mlh at vier.idi.ntnu.no
Wed Jan 30 14:42:08 EST 2002


In article <K_J58.12179$X64.4186069 at news1.rdc2.pa.home.com>, Terry Reedy wrote:
>
>"Bengt Richter" <bokr at oz.net> wrote in message
>news:a37lfj$8qg$0 at 216.39.172.122...
>> # selfrepr.py -- to demo self-reproducing (not shortest ;-) code --
>bokr 2002
>
>Hehe.   A few years ago, we had a thread on short self-reproducing
>code with several entries (some from me).  Some Pythonic (using %
>interpolation), some Lispish (using lambda).  Perhaps accessible via
>Google.

Heh... Just to restart the old thread, here is a one-line shell
command (using Python) -- join the two lines:

python -c "x='python -c %sx=%s; print x%%(chr(34),repr(x),chr(34))%s';
print x%(chr(34),repr(x),chr(34))"

>Terry J. Reedy

--
Magnus Lie Hetland                                  The Anygui Project
http://hetland.org                                  http://anygui.org



More information about the Python-list mailing list