Wednesday, March 20, 2013

Simple example using tkinter Label

Simple example using tkinter Label
Simple example using tkinter Label



#tkinter for Python 3.x
#Tkinter for Python 2.x

import tkinter

tkTop = tkinter.Tk()
tkLabel = tkinter.Label(tkTop, text="Hello python.beginner")
tkLabel.pack()
tkinter.mainloop()


Monday, March 18, 2013

Check if Tkinter installed in Python

Tkinter is Python's de-facto standard GUI (Graphical User Interface) package. It is a thin object-oriented layer on top of Tcl/Tk.

To check if Tkinter installed, type the following command in IDLE(Python Shell), for Python 2.x:

>>> import Tkinter


import Tkinter for Python 2.x
import Tkinter for Python 2.x


for Python 3.x:

>>> import tkinter

import tkinter for Python 3.x
import tkinter for Python 3.x


Install Python on Ubuntu

To install Python on Ubuntu. simple search Python in Ubuntu Software Center.

Install Python on Ubuntu
Install Python on Ubuntu


You can install both Python 2.x and 3.2 together.

Both Python 2.7.3 and 3.2.3 installed
Both Python 2.7.3 and 3.2.3 installed

google-code-prettify: syntax highlighting of source code in html page



google-code-prettify is a Javascript module and CSS file that allows syntax highlighting of source code snippets in an html page.

For an example, see the README.

Features
  • Works on HTML pages
  • Works even if code contains embedded links, line numbers, etc.
  • Simple API : include some JS&CSS and add an onload handler.
  • Lightweights : small download and does not block page from loading while running.
  • Customizable styles via CSS.
  • Supports all C-like, Bash-like, and XML-like languages. No need to specify the language
  • Extensible language handlers for other languages. You can specify the language.
  • Widely used with good cross-browser support. Powers code.google.com and stackoverflow.com


Sunday, March 17, 2013

Getting started with wxPython


Hello World using wxPython

wxPython is a GUI toolkit for the Python programming language. It allows Python programmers to create programs with a robust, highly functional graphical user interface, simply and easily. It is implemented as a Python extension module (native code) that wraps the popular wxWidgets cross platform GUI library, which is written in C++.

Like Python and wxWidgets, wxPython is Open Source which means that it is free for anyone to use and the source code is available for anyone to look at and modify. Or anyone can contribute fixes or enhancements to the project.

wxPython is a cross-platform toolkit. This means that the same program will run on multiple platforms without modification. Currently supported platforms are 32-bit Microsoft Windows, most Unix or unix-like systems, and Macintosh OS X.

Getting started with wxPython >>

Saturday, March 16, 2013

Free eBook online: Web Audio API



Go beyond HTML5’s Audio tag and boost the audio capabilities of your web application with the Web Audio API. Packed with lots of code examples, crisp descriptions, and useful illustrations, this concise guide shows you how to use this JavaScript API to make the sounds and music of your games and interactive applications come alive.

Read the book Web Audio API on-line

Thursday, March 14, 2013

Code Formatting Features in NetBeans IDE



Code Formatting Features in NetBeans IDE

This screencast demonstrates how to use a few important formatting features in the NetBeans IDE such as, general indentation, braces and others. This demonstration is based on the Formatting project available in the NetBeans Sample Code Library.