less than symbol in annotate

Post any questions, ideas, or topics related to Jython and Python scripting.
Post Reply
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

less than symbol in annotate

Post by joleenf »

Hi,

How do I get the less than symbol to actually appear on the screen when using annotate?

panel1=buildWindow(height=480,width=640)[0]
labelStr2='{} um - {} um difference ({} um clouds @ < 250K)'.format(3.9,10.4,10.4)
labelStr2Annon=panel1.annotate(labelStr2, line=450, element=600,color='white', bgColor='black', alignment=('left','center'))
User avatar
bobc
Posts: 990
Joined: Mon Nov 15, 2010 5:57 pm

Re: less than symbol in annotate

Post by bobc »

Hi Joleen -

With annotate you can use html for characters like less than or greater than (&lt and &gt respectively). This would change your code to:

Code: Select all

panel1=buildWindow(height=480,width=640)[0]
labelStr2='{} um - {} um difference ({} um clouds @ &lt 250K)'.format(3.9,10.4,10.4)
labelStr2Annon=panel1.annotate(labelStr2, line=450, element=600,color='white', bgColor='black', alignment=('left','center'))

Please let me know if you have any problems with this.

- Bob Carp
Post Reply