Community
All Communities
Products
ArcGIS Pro
ArcGIS Survey123
ArcGIS Online
ArcGIS Enterprise
Data Management
Geoprocessing
ArcGIS Web AppBuilder
ArcGIS Experience Builder
ArcGIS Dashboards
ArcGIS CityEngine
ArcGIS Spatial Analyst
All Products Communities
Industries
Education
Water Resources
State & Local Government
Transportation
Gas and Pipeline
Water Utilities
Roads and Highways
Telecommunications
Natural Resources
Electric
Public Safety
All Industries Communities
Developers
Python
JavaScript Maps SDK
Native Maps SDKs
ArcGIS API for Python
ArcObjects SDK
ArcGIS Pro SDK
Developers - General
ArcGIS REST APIs and Services
ArcGIS Online Developers
File Geodatabase API
Game Engine Maps SDKs
All Developers Communities
Worldwide
Comunidad Esri Colombia - Ecuador - Panamá
ArcGIS 開発者コミュニティ
Czech GIS
ArcNesia
Esri India
GeoDev Germany
ArcGIS Content - Esri Nederland
Esri Italia Community
Comunidad GEOTEC
Esri Ireland
Používatelia ArcGIS
All Worldwide Communities
All Communities
Products
Developers
User Groups
Industries
Services
Community Resources
Worldwide
Events
Learning
ArcGIS Topics
Networks
View All Communities
ArcGIS Ideas
GIS Life
Community Resources
Community Help Documents
Community Blog
Community Feedback
Member Introductions
Community Ideas
All Community Resources
Sign In
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Show
only
|
Search instead for
Did you mean:
Cancel
Home
:
All Communities
:
Developers
:
Python
:
Python Questions
:
arcpy bold, italic, underline stand alone script
Options
Subscribe to RSS Feed
Mark Topic as New
Mark Topic as Read
Float this Topic for Current User
Bookmark
Subscribe
Mute
Printer Friendly Page
arcpy bold, italic, underline stand alone script
Subscribe
1536
4
01-03-2012 09:19 AM
by
deleted-user-MS
0lE1F_0-sy
Occasional Contributor
01-03-2012
09:19 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
How would I Bold a portion of my text element? This script loses its next line functionality if I use <BOL></BOL>. How do I correct this?
finaltext = ("<BOL>Result1:</BOL>" + '\n' + textValue1 + '\n' + " " + '\n' + "<BOL>Result2:</BOL>" + '\n' + textValue2 + '\n' + " " + '\n' + "<BOL>Result3:</BOL>" + '\n' + textValue3 + '\n' + " ")
el1to3.text = finaltext
This script will Bold the Result1 but all the rest of it is jumbled on one line on top of each other.
I would like it to look like this-
Result1:
a
b
c
Result2:
a
b
c
Tags
(2)
Tags:
gis_developers
python
Reply
0
Kudos
All Posts
Previous Topic
Next Topic
4 Replies
by
JasonScheirer
Occasional Contributor III
01-03-2012
09:29 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
Use \r\n instead of \n
Reply
0
Kudos
by
deleted-user-MS
0lE1F_0-sy
Occasional Contributor
01-03-2012
11:01 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
This works great when I use it for one of them:
finaltext = ("<BOL>Result1:</BOL>" + '\r\n' + textValue1 + '\n' + " " + '\n' + "Result2:" + '\n' + textValue2 + '\n' + " " + '\n' + "Result3:" + '\n' + textValue3)
el1to3.text = finaltext
Result1:
is bold
However when I switch to it doesnt Bold them:
finaltext = ("<BOL>Result1:</BOL>" + '\r\n' + textValue1 + '\n' + " " + '\n' + "<BOL>Result2:<\BOL>" + '\r\n' + textValue2 + '\n' + " " + '\n' + "<BOL>Result3:<\BOL>" + '\r\n' + textValue3)
el1to3.text = finaltext
the results are:
<BOL>Result1:</BOL>
<BOL>Result2:</BOL>
<BOL>Result3:</BOL>
So it seems like I can only use the <BOL></BOL> once?
Maybe you can tell me or point to some literature on when and how to use \r\n versus \n. I must be searching for the wrong thing.
I appreciate the help.
Matt
Reply
0
Kudos
by
JasonScheirer
Occasional Contributor III
01-03-2012
11:58 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
Replace ALL \ns with \r\n and you'll need to use </BOL>, not <\BOL>.
\r\n is the convention for Windows line breaks, \n is for Unix-like systems. In some places in Windows it's forgiving and lets you use \n, but not in text elements.
Reply
0
Kudos
by
deleted-user-MS
0lE1F_0-sy
Occasional Contributor
01-04-2012
01:57 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
Got it. Simple typos always get me. Thank you for your help and knowledge.
Reply
0
Kudos
Post Reply