Jump to content

Recommended Posts

Posted (edited)
https://github.com/djfalls13/PyClock.git

This took some doing and weird formatting tricks, but it works.  I had a lot of trouble getting ASCII Art stored as Multi-Line Variable to display side by side, so I made each ASCII Art number a List to iterate through line by line. This whole project experience reminds me of art I used to see on BBSes or really old DOS games.  I used the Python Time module to control which ASCII Art number is called from a List of Lists and I used Google to look up the TIme Module formatting.  

 

 I used an online tool here to help create the Text Graphics:  http://patorjk.com/software/taag/#p=display&f=Graffiti&t=Type%20Something%20

I might try another version of this idea with the nCurses module.  I may also rework the code with OOP to make the Clock a Class Object.  That way this code could more easily be put into other programs.  

I feel that for myself this was a good project that created a useful tool having a Text Clock on my screen.  I like that this relies heavily on Iteration which I think is a tricky fundamental part of programming to learn.  I will honestly say I feel a little like my brain is fried as I try to learn a different way of thinking, but it is very rewarding to get the final working result. 

My last thought is this makes me think about what kind of niche I see myself as an avid Linux user creating this tool for the terminal.  Maybe embedded non-graphical systems that need user menus?  

I do have one question though.  I can only exit this with Control-C and wondered if there is a better way to escape a program like this. 

EDIT:  I thought I'd add one small note that this is displayed in Military style 2400 clock time on purpose or from habit.  I currently work in transportation and we use the 2400 style time by convention.  If I were inclined, I suppose I could rework this to display the normal clock with AM and PM.  

 

 

clock2.py

Edited by Dan13
Posted

The file download has formatting issues in the displayed.  I made some corrections that should work at the GitHub version I posted. 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...