In a fit of genius while I was surfing the net, I came up with a python implementation of the song "Happy Birthday". It's totally sweet!
you = Person()
for i in range(0, 4):
if i == 2:
you.name = happy_birthday
else:
you = happy_birthday
Sometimes my genius is a little subtle, so here's how it works:
- 'you' is an instance of a 'Person' object.
- The 'you = happy_birthday' is assigning "happy_birthday to you".
- The third time through 'happy_birthday' is assigned to the person objects 'name'. So if the person objects name was 'Scott', this would be assigning "happy_birthday to Scott".
And just for fun, I wrote a one liner that will print out the happy birthday song, using python:
for i in range(0, 4): print "Happy Birthday", ((i == 2 and ("Dear Scott",)) or ("to you",))[0]
hadfield on 9 Drush links to take you from beginner to advanced.
Tai Travis (Taiger) on 9 Drush links to take you from beginner to advanced.
mobility scooters on Creating Custom Triggers in Drupal
hadfield on Features Part 2 - Managing your feature
Capi Etheriel on Features Part 2 - Managing your feature
Capi Etheriel on 9 Drush links to take you from beginner to advanced.