Python Forum
How to print the current time in color
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to print the current time in color
#2
This works for me on python3.8
import timedate
from colored import fg
current_time = datetime.datetime.now().strftime('%H:%M:%S')
print(fg(11),current_time)
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags


Reply


Messages In This Thread
RE: How to print the current time in color - by menator01 - Apr-15-2020, 09:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Turtle Star Fill Color Yellow-White Interchanging Color Effect codelab 9 1,136 Oct-25-2023, 09:09 AM
Last Post: codelab
  Print names in x-axis of a time-series values hobbyist 4 1,276 Apr-22-2023, 09:29 PM
Last Post: deanhystad
  How to print results of asyncio websockets at the same time? codingmonster 0 1,787 Jun-04-2021, 01:48 PM
Last Post: codingmonster
  Print characters in a single line rather than one at a time hhydration 1 2,062 Oct-10-2020, 10:00 PM
Last Post: bowlofred
  How to print n days back date at give time Mekala 1 2,009 Oct-10-2020, 03:35 AM
Last Post: bowlofred
  Having a hard time conceptualizing how to print something MysticLord 6 3,161 Sep-19-2020, 10:43 PM
Last Post: MysticLord
  Print a certain string only the first time it appears in a test file buttercup 5 2,854 Jul-23-2020, 01:30 PM
Last Post: palladium
  calling strftime does not display current time tonytech 2 2,158 May-05-2020, 04:53 AM
Last Post: tonytech
  Print date, Time and output to file tpolim008 3 2,392 Mar-26-2020, 06:49 PM
Last Post: ndc85430
  Make color for string when print to console hadoan 6 3,478 Oct-31-2019, 01:40 PM
Last Post: hadoan

Forum Jump:

User Panel Messages

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