Bottom Page

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!
Quote
#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
Quote
#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 :)
Quote
#4
(Oct-31-2019, 03:48 AM)hadoan Wrote: Thanks you so much Bro :)

You're welcome! Smile
hadoan likes this post
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
Quote
#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.
Quote
#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,
hadoan likes this post
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
Quote
#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 :)
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Make an array of string number in a List polantas 5 227 May-27-2020, 07:18 AM
Last Post: buran
  How to print string multiple times separated by delimiter Mekala 1 170 May-23-2020, 09:21 AM
Last Post: Yoriz
  How to print the current time in color julio2000 3 206 Apr-16-2020, 10:21 AM
Last Post: julio2000
  How to print the 2nd column of a searched string in a csv ptey07 2 291 Jan-11-2020, 11:25 AM
Last Post: ptey07
  how do I make a number only print once but the number keeps on decreasing? syafiq14 5 337 Jan-03-2020, 10:34 AM
Last Post: perfringo
  Print string after decode martinzeifang 1 318 Jan-02-2020, 10:16 AM
Last Post: buran
  POS receipt print cannot make paper cut using python AP_Development 1 309 Dec-12-2019, 08:48 AM
Last Post: buran
  Print string in a single line RavCOder 8 479 Nov-08-2019, 09:45 AM
Last Post: perfringo
  modify the color a string of characters in python 3.6 atlass218 10 1,388 Feb-28-2019, 03:20 PM
Last Post: atlass218
  print console output to a csv deep_logic 3 764 Feb-21-2019, 06:41 PM
Last Post: deep_logic

Forum Jump:


Users browsing this thread: 1 Guest(s)