re: Automating Simple Things with Python is Awesome VIEW POST


A solution in ruby (because at a rival startup we prefer ruby to python)

Dir["*.1"].each { |f| File.rename(f, f.sub(/\.1$/, '')) }

There is no difference between ruby and python, though, save for syntax.


Syntax is important for expressiveness. I love both Python and Ruby for their own strengths. In this case && IMHO, Ruby wins with its one-line that mostly reads like plain english.

code of conduct - report abuse