Skip to content

Instantly share code, notes, and snippets.

@arthurfurlan
Last active December 18, 2015 11:09
Show Gist options
  • Select an option

  • Save arthurfurlan/5773970 to your computer and use it in GitHub Desktop.

Select an option

Save arthurfurlan/5773970 to your computer and use it in GitHub Desktop.
why do I like python!?
#!/usr/bin/env php
<?php
class Hello {
public function say($what) {
echo "Hello {$what}!\n";
}
}
$hello = new Hello();
$hello->say('world');
?>
## $ php -f hello.php
## Hello world!
#!/usr/bin/env python
class Hello:
def say(self, what):
print 'Hello %s!' % what
hello = Hello()
hello.say('world')
## $ ruby hello.rb
## Hello world!
#!/usr/bin/env ruby
class Hello
def say(what)
puts "Hello #{what}!"
end
end
hello = Hello.new
hello.say 'world'
## $ python hello.py
## Hello world!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment