Remove unicode characters from returned variable - Tautulli Newsletter Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Suppress the u'prefix indicating unicode' in python stringsRemove zero width space unicode character from Python stringHow to return multiple values from a function?What is the best way to remove accents in a Python unicode string?How do I remove an element from a list by index in Python?How to remove items from a list while iterating?CSS using firebug with tab computed style questionHow to remove a key from a Python dictionary?Spanish characters with Trebuchet font?Cannot display HTML stringWhy is executing Java code in comments with certain Unicode characters allowed?How do I fix “fallback” weight for different fonts?
Putting class ranking in CV, but against dept guidelines
How to write capital alpha?
Why weren't discrete x86 CPUs ever used in game hardware?
A term for a woman complaining about things/begging in a cute/childish way
Is multiple magic items in one inherently imbalanced?
How can I prevent/balance waiting and turtling as a response to cooldown mechanics
Constant factor of an array
Is it possible for SQL statements to execute concurrently within a single session in SQL Server?
Why do early math courses focus on the cross sections of a cone and not on other 3D objects?
Was Kant an Intuitionist about mathematical objects?
Question about this thing for timpani
Resize vertical bars (absolute-value symbols)
Caught masturbating at work
Monty Hall Problem-Probability Paradox
Tips to organize LaTeX presentations for a semester
I got rid of Mac OSX and replaced it with linux but now I can't change it back to OSX or windows
What is the "studentd" process?
What does the writing on Poe's helmet say?
Flight departed from the gate 5 min before scheduled departure time. Refund options
How to change the tick of the color bar legend to black
How does light 'choose' between wave and particle behaviour?
Special flights
What is the role of と after a noun when it doesn't appear to count or list anything?
Central Vacuuming: Is it worth it, and how does it compare to normal vacuuming?
Remove unicode characters from returned variable - Tautulli Newsletter
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!Suppress the u'prefix indicating unicode' in python stringsRemove zero width space unicode character from Python stringHow to return multiple values from a function?What is the best way to remove accents in a Python unicode string?How do I remove an element from a list by index in Python?How to remove items from a list while iterating?CSS using firebug with tab computed style questionHow to remove a key from a Python dictionary?Spanish characters with Trebuchet font?Cannot display HTML stringWhy is executing Java code in comments with certain Unicode characters allowed?How do I fix “fallback” weight for different fonts?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I want to include actors from films in my Tautulli newsletter for my Plex media collection. The newsletter template file is html and the language is mako so a mix of python, html and css.
This code returns the correct values
<p style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-weight: 400;margin: 0;max-width: 325px;color: #ffffff;">
Actors: $movie['actors']
</p>
It appears like
Actors: [u'Amalia Williamson', u'Celina Martin', u'Joelle Farrow']
To be usable I'd need to remove the the unicode characters
[u'
I have tried a couple of things and this was the most promising lead, however I couldn't get it to work.
Can anyone please amend the code so it will work please? Thank you!
python html unicode ascii mako
add a comment |
I want to include actors from films in my Tautulli newsletter for my Plex media collection. The newsletter template file is html and the language is mako so a mix of python, html and css.
This code returns the correct values
<p style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-weight: 400;margin: 0;max-width: 325px;color: #ffffff;">
Actors: $movie['actors']
</p>
It appears like
Actors: [u'Amalia Williamson', u'Celina Martin', u'Joelle Farrow']
To be usable I'd need to remove the the unicode characters
[u'
I have tried a couple of things and this was the most promising lead, however I couldn't get it to work.
Can anyone please amend the code so it will work please? Thank you!
python html unicode ascii mako
Possible duplicate of Remove unicode character from python string
– C. Lightfoot
Mar 22 at 12:16
Please edit the answer to show how exactly you want the output to look like.
– lenz
Mar 22 at 12:53
This thread is maybe relevant to your problem too.
– lenz
Mar 22 at 12:54
Thank you for the responses. For the above example I wanted the output to be Actors: Glynn Turman, Hailee Steinfeld, Jason The answer given by snakecharmerb worked perfectly!
– Dave Matthews
Mar 23 at 10:33
add a comment |
I want to include actors from films in my Tautulli newsletter for my Plex media collection. The newsletter template file is html and the language is mako so a mix of python, html and css.
This code returns the correct values
<p style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-weight: 400;margin: 0;max-width: 325px;color: #ffffff;">
Actors: $movie['actors']
</p>
It appears like
Actors: [u'Amalia Williamson', u'Celina Martin', u'Joelle Farrow']
To be usable I'd need to remove the the unicode characters
[u'
I have tried a couple of things and this was the most promising lead, however I couldn't get it to work.
Can anyone please amend the code so it will work please? Thank you!
python html unicode ascii mako
I want to include actors from films in my Tautulli newsletter for my Plex media collection. The newsletter template file is html and the language is mako so a mix of python, html and css.
This code returns the correct values
<p style="font-family: 'Open Sans', Helvetica, Arial, sans-serif;font-weight: 400;margin: 0;max-width: 325px;color: #ffffff;">
Actors: $movie['actors']
</p>
It appears like
Actors: [u'Amalia Williamson', u'Celina Martin', u'Joelle Farrow']
To be usable I'd need to remove the the unicode characters
[u'
I have tried a couple of things and this was the most promising lead, however I couldn't get it to work.
Can anyone please amend the code so it will work please? Thank you!
python html unicode ascii mako
python html unicode ascii mako
asked Mar 22 at 12:00
Dave MatthewsDave Matthews
31
31
Possible duplicate of Remove unicode character from python string
– C. Lightfoot
Mar 22 at 12:16
Please edit the answer to show how exactly you want the output to look like.
– lenz
Mar 22 at 12:53
This thread is maybe relevant to your problem too.
– lenz
Mar 22 at 12:54
Thank you for the responses. For the above example I wanted the output to be Actors: Glynn Turman, Hailee Steinfeld, Jason The answer given by snakecharmerb worked perfectly!
– Dave Matthews
Mar 23 at 10:33
add a comment |
Possible duplicate of Remove unicode character from python string
– C. Lightfoot
Mar 22 at 12:16
Please edit the answer to show how exactly you want the output to look like.
– lenz
Mar 22 at 12:53
This thread is maybe relevant to your problem too.
– lenz
Mar 22 at 12:54
Thank you for the responses. For the above example I wanted the output to be Actors: Glynn Turman, Hailee Steinfeld, Jason The answer given by snakecharmerb worked perfectly!
– Dave Matthews
Mar 23 at 10:33
Possible duplicate of Remove unicode character from python string
– C. Lightfoot
Mar 22 at 12:16
Possible duplicate of Remove unicode character from python string
– C. Lightfoot
Mar 22 at 12:16
Please edit the answer to show how exactly you want the output to look like.
– lenz
Mar 22 at 12:53
Please edit the answer to show how exactly you want the output to look like.
– lenz
Mar 22 at 12:53
This thread is maybe relevant to your problem too.
– lenz
Mar 22 at 12:54
This thread is maybe relevant to your problem too.
– lenz
Mar 22 at 12:54
Thank you for the responses. For the above example I wanted the output to be Actors: Glynn Turman, Hailee Steinfeld, Jason The answer given by snakecharmerb worked perfectly!
– Dave Matthews
Mar 23 at 10:33
Thank you for the responses. For the above example I wanted the output to be Actors: Glynn Turman, Hailee Steinfeld, Jason The answer given by snakecharmerb worked perfectly!
– Dave Matthews
Mar 23 at 10:33
add a comment |
1 Answer
1
active
oldest
votes
movie['actors']
appears to be a list, so rendering it will the repr of the list and its contents. Joining the invidual strings into a lrager string should do what you want.
>>> print u', '.join([u'Amalia Williamson', u'Celina Martin', u'Joelle Farrow'])
Amalia Williamson, Celina Martin, Joelle Farrow
In your template:
Actors: $u', '.join(movie['actors'])
Brilliant, worked like a charm :) Thank you very much!
– Dave Matthews
Mar 23 at 10:29
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55299178%2fremove-unicode-characters-from-returned-variable-tautulli-newsletter%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
movie['actors']
appears to be a list, so rendering it will the repr of the list and its contents. Joining the invidual strings into a lrager string should do what you want.
>>> print u', '.join([u'Amalia Williamson', u'Celina Martin', u'Joelle Farrow'])
Amalia Williamson, Celina Martin, Joelle Farrow
In your template:
Actors: $u', '.join(movie['actors'])
Brilliant, worked like a charm :) Thank you very much!
– Dave Matthews
Mar 23 at 10:29
add a comment |
movie['actors']
appears to be a list, so rendering it will the repr of the list and its contents. Joining the invidual strings into a lrager string should do what you want.
>>> print u', '.join([u'Amalia Williamson', u'Celina Martin', u'Joelle Farrow'])
Amalia Williamson, Celina Martin, Joelle Farrow
In your template:
Actors: $u', '.join(movie['actors'])
Brilliant, worked like a charm :) Thank you very much!
– Dave Matthews
Mar 23 at 10:29
add a comment |
movie['actors']
appears to be a list, so rendering it will the repr of the list and its contents. Joining the invidual strings into a lrager string should do what you want.
>>> print u', '.join([u'Amalia Williamson', u'Celina Martin', u'Joelle Farrow'])
Amalia Williamson, Celina Martin, Joelle Farrow
In your template:
Actors: $u', '.join(movie['actors'])
movie['actors']
appears to be a list, so rendering it will the repr of the list and its contents. Joining the invidual strings into a lrager string should do what you want.
>>> print u', '.join([u'Amalia Williamson', u'Celina Martin', u'Joelle Farrow'])
Amalia Williamson, Celina Martin, Joelle Farrow
In your template:
Actors: $u', '.join(movie['actors'])
answered Mar 22 at 13:15
snakecharmerbsnakecharmerb
12.3k42553
12.3k42553
Brilliant, worked like a charm :) Thank you very much!
– Dave Matthews
Mar 23 at 10:29
add a comment |
Brilliant, worked like a charm :) Thank you very much!
– Dave Matthews
Mar 23 at 10:29
Brilliant, worked like a charm :) Thank you very much!
– Dave Matthews
Mar 23 at 10:29
Brilliant, worked like a charm :) Thank you very much!
– Dave Matthews
Mar 23 at 10:29
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55299178%2fremove-unicode-characters-from-returned-variable-tautulli-newsletter%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Possible duplicate of Remove unicode character from python string
– C. Lightfoot
Mar 22 at 12:16
Please edit the answer to show how exactly you want the output to look like.
– lenz
Mar 22 at 12:53
This thread is maybe relevant to your problem too.
– lenz
Mar 22 at 12:54
Thank you for the responses. For the above example I wanted the output to be Actors: Glynn Turman, Hailee Steinfeld, Jason The answer given by snakecharmerb worked perfectly!
– Dave Matthews
Mar 23 at 10:33