How To Create Transparent Digital Watch using wxpython

How To Create Transparent Digital Watch using wxpython
Python Training in Meerut #Author: ManishHacker1

How To Create Transparent Digital Watch Using Python

Hello Guys.. I am Manish. I hope, all of you will be very well. Today, we will be work on Desktop Application Development using WxPython.

WxPython is a most popular python library used for Desktop Application Development. Here, we will create a Transparent Digital Watch with the help of WxPython library. So, first of all we will install WxPython library.

Method 1:

Open your command prompt and type:

---> pip install wxpython 
and press enter button.

Method 2:

Open Google Search Engine and search: Download wxpython 2.7 and click on.. Source:Download

After downloading, we will install wxpython library. Next next next.. ok ok ok…

After installation we will confirm that our wxpython library successfully install or not. So, open our python IDLE interpreter and type:

import wx

If you don’t have got any error message that mean your wxpython library successfully installed in your computer or laptop.
Fine.. Now we will work on our main course. Before working on this project we must knowledge about some python module.

  • Class
  • Object
  • Time
  • Function
  • About constructor
  • Some basic knowledge of wxpython

Now, we are ready to develop our Transparent Digital Watch.

Full Source 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)

    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.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))

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

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


Thank You for reading this article. I hope you will have enjoyed read this article.If you want to learn more interesting article. Then subscribe,share and like.Thank you very much for your support and love.

And also like my FB page given below link and share it.

Best Python Training and Ethical Hacking Training in Meerut, Noida , Delhi.

Krypsec Digital Security Provided Python Training
  • Best Python Training in Noida
  • Best Python Training in Delhi
  • Best Python Training in Meerut
  • Best Python Training in India

Source: Python Secret

Source: Python

Follow ManishHacker1

Leave a Reply

Your email address will not be published. Required fields are marked *