python vs. perl readability

Carl Banks imbosol-1046977880 at aerojockey.com
Thu Mar 6 14:50:22 EST 2003


Hilbert wrote:
> Hello,
> 
> A friend of mine uses perl at work, I'm converting
> to python. I've showed him a couple of times how
> much easier it is to read python code than perl, but
> last night he sent me this:
> (I know it's ajoke, just wanted to share...)
> 
> 
> -------
> import sys
> 
> z,x,y= "}{|}A|k{|kA|}=BE1)|BF}))|$}:~pI~/;@Go{H%{&A?|if }:~pJ"\
>       "IJ-1~#>=0:GoAG at HG;o{G;%-I&{?|m,kJ,j=C?;/@~o{~D:Gl[c]("\
>       ")?","G$p:%~;%~;el!]':p%break~;![':p%#<len(j):~%\n\t\t"\
>       "%if c=='%while o%\n%m[k]%+=1%\t%if not %c=j[o]%-=1%sy"\
>       "s.std%[0]*64000,0,0,open(sys.argv[1]).read()%if l.has"\
>       "_key(c)%in.read(%out.write(chr(%=1%,o".split('%'),"HG"\
>       "&%/~!#?}{;$@ABCDEFIJ"
> 
> for i in range(len(x)):z=z.replace(y[i],x[i])
> z=z.split('|')
> for o in range(9):
>    exec("def %c():\n\tglobal k,m,o,j\n\t%s\n"%(chr(97+o),z[o]))


Obfuscation by use of exec is false wit.


> l={'>':c,'<':d,'-': b,'+':a,',':e,'.':f,'[':g,']':h}
> i()
> ------------------------------


-- 
CARL BANKS




More information about the Python-list mailing list