WP-SynHighlight


I found a plugin for adding Python code to my posts. It’s called WP-SynHighlight. I’m not sure it works well with my theme, though. Here is an example:

  1. # produce a multiplication table with the number of rows and columns defined by the user
  2. columns = int(raw_input("Input the number of columns: "))
  3. rows = int(raw_input("Input the number of rows: "))
  4. longest = len(str(columns * rows)) # find out how many digits are needed for rjust() to format table evenly
  5. for table in range (1, rows+1):
  6. for table2 in range (1, columns+1):
  7. result = table * table2
  8. print str(result).rjust(longest),
  9. print

Some of the code is white on a white background. Now I need to figure out how to change that background or change the color of the text.

Related posts:

  1. timestable.py
  2. Python Sudoku solver
  3. Working on the bike problem with Python
  4. Programming with Python
  5. The bike saga continues

One thought on “WP-SynHighlight

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>