Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
colouring strings
#14
(Sep-17-2019, 10:11 PM)snippsat Wrote: I did post this,so term.py is just name i used for your code that i run in cmder
[quote="snippsat" pid="91773" dateline="1568737421"]Test term.py is your latest code.
Wall I'm so thick ... I'm so thick ... I'm so thick ... I'm so thick ... I'm so thick ... I'm so thick ... I'm so thick ... I'm so thick ...

I don't know why, but I thought term.py was some kind of test program, not the code I had attached!!!

I don't know what I was doing or where I was doing it, because as I had posted previously, the pip installation for colorama and for termcolor was successful on both cases. Finally, I have managed to make both of them work, but they don't fulfill my expectations ... Cry

I wanted something like here, with the so-called HTML-like tags, very straightforward and easy.

Incidentally, I've been learning many little pieces of many things through my investigation, but still I don't think I've found yet what I wanted.

Let's compare, for instance, the code we need to show something here in a post. We can modify the font, its size, colour or appearance, like bold, italic, or underline. If we want a word underlined, we just surround that word with the pair of tags [*u][*/u] (I just added the asterisks inside the tags to make the tags visible, as otherwise, we would see the characteristics applied, but not the tags), no need to even use the word 'underline', the same goes with bold [*b][*/b], or italic [*i][*/i]. Okay, so, if I wanted a string like 'I like python-forum... a lot!' with a bit of formatting like 'I like python-forum... a lot!', I just have to put 'python-forum' in the center of these paired-tags: [*color=#1ABC9C][*u][*b][*/b][*/u][*/color], and 'a lot!' surrounded by the pair of tags [*i][*/i]. What's more, I didn't even have to write those tags, but instead, I selected the piece of string that I wanted to be changed in style Dance and then clicked on the options on the top of the reply box. That easy!!! Clap
Well, that's oversimplifying the issue, as I guessed there must be a lot of code behind it, but once you run it, you just have to go to the reply box, write what you want and select the strings you want to be formatted, apply the characteristics you want, by just clicking on the icons of your desired characteristics and then, by clicking on the Post Reply button, you can see your strings formatted, once and again!
If I want that same little sentence formatted with one of the programs available for Python, it would require a bit more effort.

λ python -V
Python 3.7.2

λ pip -V
pip 19.2.3 from c:\python37\lib\site-packages\pip (python 3.7)
Thanks, nice tips to check versions!

All the best,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply


Messages In This Thread
colouring strings - by newbieAuggie2019 - Sep-17-2019, 03:06 AM
RE: colouring strings - by wavic - Sep-17-2019, 03:14 AM
RE: colouring strings - by newbieAuggie2019 - Sep-17-2019, 04:23 PM
RE: colouring strings - by snippsat - Sep-17-2019, 04:42 PM
RE: colouring strings - by newbieAuggie2019 - Sep-17-2019, 09:46 PM
RE: colouring strings - by newbieAuggie2019 - Sep-17-2019, 04:48 PM
RE: colouring strings - by snippsat - Sep-17-2019, 05:13 PM
RE: colouring strings - by newbieAuggie2019 - Sep-17-2019, 05:37 PM
RE: colouring strings - by snippsat - Sep-17-2019, 06:22 PM
RE: colouring strings - by wavic - Sep-17-2019, 08:50 PM
RE: colouring strings - by snippsat - Sep-17-2019, 10:11 PM
RE: colouring strings - by newbieAuggie2019 - Sep-20-2019, 07:27 AM
RE: colouring strings - by wavic - Sep-18-2019, 08:25 AM
RE: colouring strings - by wavic - Sep-18-2019, 11:10 AM
RE: colouring strings - by newbieAuggie2019 - Sep-20-2019, 06:34 PM
RE: colouring strings - by newbieAuggie2019 - Sep-22-2019, 07:12 AM
RE: colouring strings - by newbieAuggie2019 - Sep-22-2019, 09:07 AM
RE: colouring strings - by jquast - Oct-22-2019, 02:28 PM
RE: colouring strings - by newbieAuggie2019 - Oct-22-2019, 03:31 PM
RE: colouring strings - by newbieAuggie2019 - Sep-24-2019, 10:42 AM
RE: colouring strings - by wavic - Sep-24-2019, 01:28 PM
RE: colouring strings - by newbieAuggie2019 - Sep-30-2019, 08:20 PM
RE: colouring strings - by jquast - Oct-23-2019, 03:44 AM
RE: colouring strings - by newbieAuggie2019 - Oct-23-2019, 08:59 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to understand strings and lists of strings Konstantin23 2 816 Aug-06-2023, 11:42 AM
Last Post: deanhystad
  Splitting strings in list of strings jesse68 3 1,818 Mar-02-2022, 05:15 PM
Last Post: DeaD_EyE
  Finding multiple strings between the two same strings Slither 1 2,547 Jun-05-2019, 09:02 PM
Last Post: Yoriz
  lists, strings, and byte strings Skaperen 2 4,264 Mar-02-2018, 02:12 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020