Skip to main content

Create Transparent Digital Watch Using wxPython

Krypsec Digital Watch
Code
#Krypsec Digital Watch
#Author: ManishHacker1

import wx
import time

class MyDialog(wx.Dialog):
def __init__(self, parent, id, title):
wx.Dialog.__init__(self, parent, id, title, size = (480, 210))


self.Bind(wx.EVT_PAINT, self.OnPaint)
self.timer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.OnTimer, self.timer)
self.timer.Start(1000)



def Draw(self, dc):
t = time.localtime(time.time())
st = time.strftime("%b %d %y,%a \n \t \t \t %I:%M:%S", t)
dc.SetBackground(wx.GREY_BRUSH)
self.SetTransparent(225)
dc.Clear()
dc.SetFont(wx.Font(50, wx.SWISS, wx.NORMAL, wx.NORMAL))

tw, th = dc.GetTextExtent(st)
dc.DrawText(st, 20, 20)


def OnTimer(self, evt):
dc = wx.BufferedDC(wx.ClientDC(self))
self.Draw(dc)

def OnPaint(self, evt):
dc = wx.BufferedPaintDC(self)
self.Draw(dc)

class MyApp(wx.App):
def OnInit(self):
dlg = MyDialog(None, -1, 'Krypsec Digital Watch')
dlg.ShowModal()
dlg.Destroy()
return True

app = MyApp(0)
app.MainLoop()

Output

Krypsec Digital Watch



You can also download Digital Watch installer for your Windows Operating System givin below link.

Download

Kryptora Digital Security Provided Python Training and Ethical Hacking Training
  • Best Python Training in Noida
  • Best Python Training in Delhi
  • Best Python Training in Meerut
  • Best Python Training in India
  • Best Ethical Hacking Training in Noida
  • Best Ethical Hacking Training in Delhi
  • Best Ethical Hacking Training in Meerut
  • Best Ethical Hacking Training in India

Follow ManishHacker1

Follow ManishHacker1

Comments