Andreas' practical language comparison
Dan Bishop
danb_83 at yahoo.com
Sun Apr 25 20:12:21 EDT 2004
Andreas Koch <nospam at kochandreas.com> wrote in message news:<c6glig$phm$07$4 at news.t-online.com>...
> Hi all,
>
> i started a little "practical language comparison" - practical
> in the sense that i compare how actual distributions and versions
> and their libraries (not abstract language specifications) solve small
> test cases like the 8 queens problem.
>
> Currently there are contributions for 17 different languages, and
> none for Phyton (and Lisp. And Forth. And many others ).
> If someone is interested in contributing a few implementations,
> please have a look at:
>
> http://www.kochandreas.com/home/language/lang.htm
>
> and mail me your code snippets (or critics) or post them here.
# ************ Sort 2 ************
import sys
lines = file(sys.argv[1]).readlines()
lines.sort()
file('sorted.txt', 'w').writelines(lines)
# ************ Type "file" ************
import sys
for line in file(sys.argv[1]):
print line
More information about the Python-list
mailing list