Category Archives: Python

PyQt4 sample program done :-)

Hello friends

,Python and Qt4 are excellent combination in making GUI application.We can design any complex GUI in qt and it can be converted into python code.Actually in qt we are designing the ui(userinterface )file and converting to .py tat is python file.

This are the steps to make Hello World program using pyqt

1.Take the Qt4 Designer and create a Widget as shown in the image

2.Drag a Swich box and name it as hello world

3.Save the ui file

4.And enter the commands shown in the image

Enjoy…

Tagged

Python Qt4 Tutorial links

Python and Qt are the best combination to make a GUI.Programming in python is very simple and Qt has a lot of GUI functions..Below shows some useful links to connect python to Qt

http://zetcode.com/tutorials/pyqt4/

http://www.cs.usfca.edu/~afedosov/qttut/

Tagged

Program your Symbian Phones using Python :-)

Symbian 60 Series phones have a dedicated python interpreter called PyS60,Very interesting,that is we can program the phone using python and also we can fetch the python terminal of the phone in to the linux terminal and we can do anything..We can access the camera,sensors like accelerometer ,gyroscope..everything…Amazing Ryte..

I will give the necessary steps to fetch the python interpreter of phone to the PC in GNU/Linux

1:You need following tools given below

hcitool to find your mobile device
sdptool and ‘sdpd’ daemon to register services like serial port
rfcomm to emulate serial port over bluetooth
cu or any other terminal program

2.Instructions

Plug-in your bluetooth adapter, and then from the shell:

$ hciconfig reset

Then check that the device exists by typing:

$ hcitool dev
Register a serial port (use channel 2. For some reason, channel 1 and channel 3 might not let the connection through)

$ sdptool add –channel=2 SP

Now listen to the channel:

$ rfcomm listen rfcomm2 2

In your phone, make sure bluetooth is on, then go to the Python application and then select the Bluetooth Console. Select from the list of available devices your computer’s bluetooth adapter (you might need to select search even if you think you have already defined the pairing). If the operation is successful, you should see something similar to the following on your computer’s shell:

Waiting for connection on channel 2
Connection from 00:11:9F:BE:47:CA to /dev/rfcomm2
Press CTRL-C for hangup

Now open a new shell terminal and execute:

$ cu -l /dev/rfcomm2

You’re now in control of your mobile’s python console 🙂

NOTE: In some Linux distributions cu command is not a shell built-in. In that case you must use the minicom program which is equivalent to cu.
Example: In Pardus Linux type sudo pisi it minicom to install it.

Tested with:
Nokia 6630, Ubuntu 7.10.
N73, Ubuntu 7.04, Thinkpad T42p.
N95, Debian (kernel 2.6.26) – you need to use minicom -o instead of cu
Nokia 5530, Gentoo (kernel 2.6.30, bluez 4.39-r2)
Nokia 6110 Navigator, Ubuntu 10.04. Use minicom -o -D /dev/rfcomm2
Nokia 5230, Debian 5 Lenny (stable). Use screen /dev/rfcomm2

Notes:
This procedure doesn’t work on Ubuntu 8.04 due a bug in bluez-utils and can be temporally fixed till hardy is updated installing debian sid package

Enjoy…..

Tagged , ,

Python:A new look to programming

Python is a general-purpose high-level programming language whose design philosophy emphasizes code readability. Python aims to combine “remarkable power with very clear syntax”, and its standard library is large and comprehensive. Its use of indentaPython is a general-purpose high-level programming language whose design philosophy emphasizes code readability. Python aims to combine “remarkable power with very clear syntax”, and its standard library is large and comprehensive. Its use of indentation for block delimiters is unusual among popular programming languages.
Python supports multiple programming paradigms, primarily but not limited to object oriented, imperative and, to a lesser extent, functional programming styles. It features a fully dynamic type system and automatic memory management, similar to that of Scheme, Ruby, Perl, and Tcl. Like other dynamic languages, Python is often used as a scripting language, but is also used in a wide range of non-scripting contexts.tion for block delimiters is unusual among popular programming languages.
Python supports multiple programming paradigms, primarily but not limited to object oriented, imperative and, to a lesser extent, functional programming styles. It features a fully dynamic type system and automatic memory management, similar to that of Scheme, Ruby, Perl, and Tcl. Like other dynamic languages, Python is often used as a scripting language, but is also used in a wide range of non-scripting contexts.

Tagged