Community
All Communities
Products
ArcGIS Pro
ArcGIS Survey123
ArcGIS Online
ArcGIS Enterprise
Data Management
ArcGIS Experience Builder
Geoprocessing
ArcGIS Web AppBuilder
ArcGIS Dashboards
ArcGIS Field Maps
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
Imagery and Remote Sensing Insights (IRIS) COP
All Industries Communities
Developers
Python
JavaScript Maps SDK
Native Maps SDKs
ArcGIS API for Python
ArcGIS Pro SDK
ArcObjects SDK
Developers - General
ArcGIS REST APIs and Services
ArcGIS Online Developers
Game Engine Maps SDKs
File Geodatabase API
All Developers Communities
Global
Comunidad Esri Colombia - Ecuador - Panamá
ArcGIS 開発者コミュニティ
Czech GIS
ArcNesia
Esri India
Comunidad GEOTEC
Europe
GeoDev Germany
Americas
Asia Pacific
ArcGIS Content - Esri Nederland
All Global Communities
All Communities
Developers
User Groups
Industries
Services
Community Resources
Global
Events
Learning
Networks
ArcGIS Topics
Products
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
Select to view content in your preferred language
Translate Now
arcpy bold, italic, underline stand alone script
Subscribe
1900
4
01-03-2012 09:19 AM
by
deleted-user-MS
0lE1F_0-sy
Deactivated User
01-03-2012
09:19 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
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
Esri Alum
01-03-2012
09:29 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Use \r\n instead of \n
Reply
0
Kudos
by
deleted-user-MS
0lE1F_0-sy
Deactivated User
01-03-2012
11:01 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
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
Esri Alum
01-03-2012
11:58 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
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
Deactivated User
01-04-2012
01:57 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Got it. Simple typos always get me. Thank you for your help and knowledge.
Reply
0
Kudos
Post Reply