Python Forum

Full Version: Make color for string when print to console
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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!
(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,
(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 :)
(Oct-31-2019, 03:48 AM)hadoan Wrote: [ -> ]Thanks you so much Bro :)

You're welcome! Smile
(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.
(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,
(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 :)