From 4e115f544839160cee94162b6d8851720ff8b7b4 Mon Sep 17 00:00:00 2001 From: Ronit Thakur Date: Mon, 27 Mar 2023 11:57:41 +0530 Subject: [PATCH] my commit --- Digital clock (2).ipynb | 71 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Digital clock (2).ipynb diff --git a/Digital clock (2).ipynb b/Digital clock (2).ipynb new file mode 100644 index 0000000..4223c8b --- /dev/null +++ b/Digital clock (2).ipynb @@ -0,0 +1,71 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "5d81c667", + "metadata": {}, + "outputs": [], + "source": [ + "from tkinter import *\n", + "from time import *\n", + "\n", + "def update():\n", + " time_string = strftime(\"%I:%M:%S %p\")\n", + " time_label.config(text=time_string)\n", + "\n", + " day_string = strftime(\"%A\")\n", + " day_label.config(text=day_string)\n", + "\n", + " date_string = strftime(\"%B %d, %Y\")\n", + " date_label.config(text=date_string)\n", + "\n", + " window.after(1000,update)\n", + "\n", + "window = Tk()\n", + "\n", + "time_label = Label(window,font=(\"calibri\",150),fg=\"dark green\",bg=\"black\")\n", + "time_label.pack()\n", + "\n", + "day_label = Label(window,font=(\"calibri\",50,\"bold\"),fg=\"black\")\n", + "day_label.pack()\n", + "\n", + "date_label = Label(window,font=(\"calibri\",50,\"bold\"),fg=\"black\")\n", + "date_label.pack()\n", + "\n", + "update()\n", + "\n", + "window.mainloop()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "dfad14d3", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.12" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}