Book: “Tkinter GUI Application Development Hotshot”

After many months of writing, my first ever book finally stands published. This book is titled: “Tkinter GUI Application Development Hotshot” and it has been published by Packt Publishing, a market leader in publishing technical books on open source software. Key Features 1) Book explains GUI programming in Tkinter by developing 10 real world applications […]

Multi-Threaded TCP/IP Port Scanner in Python

Majority of communication over Internet happens using TCP. For instance, the web server normally resides on TCP port 80, email server on port 25, and FTP server on port 21. Here’s the code for conducting a TCP full connect scan. from socket import * from threading import * def connect_to_host(host, port): lock_object = Semaphore(value=1) try: […]

Tkinter ttk Treeview Simple Demo

Did not find a suitable documentation for ttk Treeview widget. Keeping it here for records and reference. from Tkinter import * import ttk root = Tk() tree = ttk.Treeview(root) tree[“columns”]=(“one”,”two”) tree.column(“one”, width=100 ) tree.column(“two”, width=100) tree.heading(“one”, text=”coulmn A”) tree.heading(“two”, text=”column B”) tree.insert(“” , 0, text=”Line 1″, values=(“1A”,”1b”)) id2 = tree.insert(“”, 1, “dir2″, text=”Dir 2”) tree.insert(id2, […]

Getting Started with HTML5 Canvas

HTML5 canvas markup is expected to take the web by storm as new avenues for its usage are being explored by advertisers, artists, educators, game developers, media, data visualizers and others. HTML5 implements many new and exciting feature and canvas is perhaps the most powerful of these. This is the first in a series of […]

Tkinter Color Chooser Dialog Simple Demo

Here’s a quick demo of Color Chooser Dialog from Tkinter. Python 2.x Version from Tkinter import * from tkColorChooser import askcolor def getColor(): color = askcolor() print color Button(text=’Select Color’, command=getColor).pack() mainloop() Python 3.x Version from tkinter import * from tkinter.colorchooser import * def getColor(): color = askcolor() print color Button(text=’Select Color’, command=getColor).pack() mainloop() The […]

Hiding Javascript Errors from Displaying in the Browser

While there are no excuses for a buggy code in our websites, sometimes error do creep in. To avoid this from displaying in your browser console, you can use a java script code like this: function HideErrorMessages() { return true; } window.onerror = HideErrorMessages; This will hide any error notice from your website visitors. Let […]

Paypal API Country Code Approved List Array

Strangely I could not find it anywhere on the net. I had to make this manually as an array. Here’s the array – to save you the labor :) The code has been taken from Paypal Objects – just in case you need to verify its correctness. Here’s the list : $countrylist = array ( […]

Simplest Web Browser in Python & Tkinter – 32 lines of code

Want to develop a web browser in python – let me get you started with a small working prototype. This GUI interface done in Tkinter and uses the urllib module to get the url data. The web browser currently looks like this: As you can see, the browser can read the contents of a site […]