Prototyping/Soldier Soldier Will You Marry Me: Difference between revisions

From XPUB & Lens-Based wiki
 
Line 60: Line 60:


See [[Variable Television]] for an example of manipulating an SVG as an XML object in Python.
See [[Variable Television]] for an example of manipulating an SVG as an XML object in Python.
== Assignment for next week ==
Based on the past two weeks, use the tools we've been exploring (python, inkscape, bash), create reworking of a "public domain" work.

Latest revision as of 18:43, 20 October 2011

Soldier, Soldier, Will You Marry Me

Lyrics

Soldier, soldier, will you marry me
With your musket, fife and drum?
Oh how can I marry such a pretty little girl
When I have no coat to put on?

Off to the tailor she did go
As fast as she could run
She brought him back the finest that was there
Now soldier, put it on

Soldier, soldier, will you marry me
With your musket, fife and drum?
Oh how can I marry such a pretty little girl
When I have no shoes to put on?

Off to the cobbler she did go
As fast as she could run
She brought him back the finest that was there
Now soldier, put them on

Soldier, soldier, will you marry me
With your musket, fife and drum?
Oh how can I marry such a pretty little girl
When I have no hat to put on?

Off to the hatter she did go
As fast as she could run
She brought him back the finest that was there
Now soldier, put it on

Soldier, soldier, will you marry me
With your musket, fife and drum?
Oh how can I marry such a pretty little girl
When I've a wife and child at home?

Links

Exercise

"Compress" the lyrics by expressing as a Python script using a loop.

Python basics

  • Variables
  • Assignment
  • Printing with variables (including the format method)
  • For loop
  • For loops, and the range function

Generate SVGs with Python

See Variable Television for an example of manipulating an SVG as an XML object in Python.