Skip to main content.

 
Due: Friday Jan 26, 2006; 10:00PM

Textify

Write a Python script (program) that will take a string as a command-line argument and decorate the individual letters in the string with a random color and font. Your program should print the output to standard out in HTML format.

Here is a sample of how your script should run (the bold lines are what the user types):

$ ./textify.py 'Hello world!'
<html>
  <head><title></title></head>
  <body><big>
   <font face="Big Caslon" color="#7961BE">H</font>
   <font face="Baskerville" color="#62F68C">e</font>
   <font face="Gill Sans" color="#84C2F3">l</font>
   <font face="Verdana" color="#AE5B02">l</font>
   <font face="Big Caslon" color="#3C77F2">o</font>
   <font face="Optima" color="#FAE093"> </font>
   <font face="Arial" color="#6C328F">w</font>
   <font face="Optima" color="#AD449D">o</font>
   <font face="Big Caslon" color="#AAB45B">r</font>
   <font face="Lucida Grande" color="#620A33">l</font>
   <font face="Copperplate" color="#786372">d</font>
   <font face="Verdana" color="#80B16C">!</font>
  </big></body>
</html>


$ ./textify.py
  textify.py, 2006 Nadeem Abdul Hamid
  Usage:
        textify.py [-t page_title] string


$ ./textify.py -t 'Test' A   
<html>
  <head><title>Test</title></head>
  <body><big>
   <font face="Verdana" color="#61B746">A</font>
  </big></body>
</html>

Notes

Submit

Submit your Python script in the prog01 submit folder for this class.