Python Forum
Make color for string when print to console
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Make color for string when print to console
#1
Hi Everyone.

I want to make color for text, string when print into the console window but could not.

I have searched on google but not lucky.

How to do that ?

My Python ver 3.7.4

Thanks in advance!
Reply
#2
(Oct-31-2019, 02:19 AM)hadoan Wrote: Hi Everyone.

I want to make color for text, string when print into the console window but could not.

I have searched on google but not lucky.

How to do that ?

My Python ver 3.7.4

Thanks in advance!

Hi!

It depends on which console you are using. You cannot do it with the Python 3.7.4 Shell. You could use for instance Cmder instead.

You also need to install and then import a module dedicated to use and format colour in python, and then make a program or use formatting according to the module you have installed.

More information here, where I compare different such modules and show some little programs on how to use their characteristics:

https://python-forum.io/Thread-colouring-strings

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
#3
(Oct-31-2019, 03:32 AM)newbieAuggie2019 Wrote:
(Oct-31-2019, 02:19 AM)hadoan Wrote: Hi Everyone.

I want to make color for text, string when print into the console window but could not.

I have searched on google but not lucky.

How to do that ?

My Python ver 3.7.4

Thanks in advance!

Hi!

It depends on which console you are using. You cannot do it with the Python 3.7.4 Shell. You could use for instance Cmder instead.

You also need to install and then import a module dedicated to use and format colour in python, and then make a program or use formatting according to the module you have installed.

More information here, where I compare different such modules and show some little programs on how to use their characteristics:

https://python-forum.io/Thread-colouring-strings

All the best,
Thanks you so much Bro :)
Reply
#4
(Oct-31-2019, 03:48 AM)hadoan Wrote: Thanks you so much Bro :)

You're welcome! Smile
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
#5
(Oct-31-2019, 05:04 AM)newbieAuggie2019 Wrote:
(Oct-31-2019, 03:48 AM)hadoan Wrote: Thanks you so much Bro :)

You're welcome! Smile

Hi Bro.

Sorry, I have another question.

1. How to run exe file which compacted from py file of python by cmder
2. Is there anyway to compact py file ( included cmder ) ... I want to copy folder after compacted into another PC and run exe python file on that by cmder.
Reply
#6
(Oct-31-2019, 07:14 AM)hadoan Wrote: 1. How to run exe file which compacted from py file of python by cmder
2. Is there anyway to compact py file ( included cmder ) ... I want to copy folder after compacted into another PC and run exe python file on that by cmder.

Hi again!

If I understand correctly, I would download and install on your other computer, Python 3.7.4 and Cmder directly from these sites:

https://www.python.org/downloads/release/python-374/

https://cmder.net/

and then, if you have already programs written in python in your original computer, I would copy in an USB memory those programs and then paste them on the python37 folder of your second computer.

I hope it helps.

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
#7
(Oct-31-2019, 11:47 AM)newbieAuggie2019 Wrote:
(Oct-31-2019, 07:14 AM)hadoan Wrote: 1. How to run exe file which compacted from py file of python by cmder
2. Is there anyway to compact py file ( included cmder ) ... I want to copy folder after compacted into another PC and run exe python file on that by cmder.

Hi again!

If I understand correctly, I would download and install on your other computer, Python 3.7.4 and Cmder directly from these sites:

https://www.python.org/downloads/release/python-374/

https://cmder.net/

and then, if you have already programs written in python in your original computer, I would copy in an USB memory those programs and then paste them on the python37 folder of your second computer.

I hope it helps.

All the best,
Hi Bro

Thanks you so much :)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Turtle Star Fill Color Yellow-White Interchanging Color Effect codelab 9 902 Oct-25-2023, 09:09 AM
Last Post: codelab
  Remove a space between a string and variable in print sie 5 1,706 Jul-27-2022, 02:36 PM
Last Post: deanhystad
  Make console show after script was built with Pyinstaller --NOCONSOLE? H84Gabor 0 1,189 May-05-2022, 12:32 PM
Last Post: H84Gabor
  Can you print a string variable to printer hammer 2 1,891 Apr-30-2022, 11:48 PM
Last Post: hammer
  Print first day of the week as string in date format MyerzzD 2 1,980 Sep-29-2021, 06:43 AM
Last Post: MyerzzD
  How to make print without newline but wait in between each print? Adrian_L 6 3,028 Apr-01-2021, 09:59 PM
Last Post: Adrian_L
  if a string has a digit - print tester_V 2 2,081 Jan-16-2021, 04:48 AM
Last Post: tester_V
  How to print string multiple times on new line ace19887 7 5,571 Sep-30-2020, 02:53 PM
Last Post: buran
  Print a certain string only the first time it appears in a test file buttercup 5 2,698 Jul-23-2020, 01:30 PM
Last Post: palladium
  Make an array of string number in a List polantas 5 3,030 May-27-2020, 07:18 AM
Last Post: buran

Forum Jump:

User Panel Messages

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