Python Forum
Make color for string when print to console - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Make color for string when print to console (/thread-22130.html)



Make color for string when print to console - hadoan - Oct-31-2019

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!


RE: Make color for string when print to console - newbieAuggie2019 - Oct-31-2019

(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,


RE: Make color for string when print to console - hadoan - Oct-31-2019

(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 :)


RE: Make color for string when print to console - newbieAuggie2019 - Oct-31-2019

(Oct-31-2019, 03:48 AM)hadoan Wrote: Thanks you so much Bro :)

You're welcome! Smile


RE: Make color for string when print to console - hadoan - Oct-31-2019

(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.


RE: Make color for string when print to console - newbieAuggie2019 - Oct-31-2019

(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,


RE: Make color for string when print to console - hadoan - Oct-31-2019

(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 :)