Casper2017
Posts: 56
Joined: Thu Mar 23, 2017 12:44 pm

Large Printing for example time.

Sun Apr 23, 2017 1:48 pm

Hi

Dose anyone know or point to on how to produce a extremely large font in Python that covers the whole screen, for example the displaying of time.

The idea is, so the program gives a blank screen and the time can be centered in the middle of the screen in a large font.

Thanks, appreciate any information.

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Large Printing for example time.

Sun Apr 23, 2017 2:15 pm

This should get you started.

Code: Select all

#!/usr/bin/python

from Tkinter import *
import time

root = Tk()
time1 = ''

clockDisplay = Label(root, font = ('fixed',144, 'bold'))
clockDisplay.grid(row = 2, column = 5, columnspan = 2, padx = 5, pady = (2,2))

def tick():
    global time1
    time2 = time.strftime('%H:%M:%S')
    if time2 != time1:
        time1 = time2
        clockDisplay.config(text=time2)
    clockDisplay.after(200, tick)

tick()
root.mainloop()
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Casper2017
Posts: 56
Joined: Thu Mar 23, 2017 12:44 pm

Re: Large Printing for example time.

Mon Apr 24, 2017 10:38 am

Thank you so much for all of this, I can start programing straight away , I just needed that extra
insight.
It has made life much easier.

Thanks

Return to “Python”