Category Archives: Python

Nokia E-63 on Linux

Recently I bought a Nokia E-63 Symbian Series 60 3rd edition smartphone. It looks similar to the Blackberry smartphones. It has got QWERTY keypad, WiFi, 2MP Camera, 3G and Bluetooth. I have been using Nokia 6300 for a long time; and a month ago it fell down and the panel got broken. After the fall [...]
Also posted in Applications, Hardware, Linux, Personal, Scripts, Tips, Ubuntu | Tagged , , , , | 7 Comments

Building your own game using pygame

These days I was experimenting with pygame and found out that how easy game development can be done with pygame. I build a ‘Space War’ clone using pygame with some sound effects. Now I’m making a HOWTO on building the games using pygame. When it is complete I will post it here.. [DOWNLOAD SPACEWAR SOURCE] var [...]
Also posted in Linux, Programming | Tagged , , | 1 Comment

Python Networking: Send Emails using smtplib

Here is a small application in Python for sending email messages via SMTP ===================================================== #!/usr/bin/python import smtplib fromAddr = raw_input(’From: ‘) toAddr = raw_input(’To: ‘) Subject = raw_input(’Subject: ‘) Message = raw_input(’Message: ‘) Email = ‘Subject: ‘+Subject+’\n\n’+Message Server = smtplib.SMTP(”BlackPearl”,25) Server.sendmail(fromAddr, toAddr, Email) print ‘Your Email has been sent to ‘, toAddr ==================================================== If your system has two users “root” and “leaf” you should have two email accounts [...]
Also posted in Linux, Programming | Leave a comment

Python Socket: Updated Client Server

This is a modification of the previous one #!/usr/bin/python import socket import sys if len(sys.argv) < 3: <tab>print ‘Usage: %s [hostname] [portnumber]‘ % sys.argv[0] <tab> sys.exit(1) server = sys.argv[1] port = int(sys.argv[2]) msg = ’start’ #Setup a standard internet socket. Connects to a server sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM) sock.connect((server,port)) while msg != ‘exit’: <tab> msg = raw_input(’Enter a Message: ‘) <tab>sock.send(msg) <tab>data = sock.recv(1024) <tab>print ‘Received Message: ‘, data sock.close() #!/usr/bin/python import socket import sys if len(sys.argv) < [...]
Also posted in Linux, Programming | Leave a comment