Skip to main content

Posts

Showing posts from June, 2014

wordpuzzle solver

Most of the *nix systems contains the wordlist. This script will use that wordlist to search the words for the given pattern. #!/usr/bin/python import re import sys if len(sys.argv[:]) != 2: print "usage: ./puzzle.py 'pattern'" exit(0) pattern = sys.argv[1] length = len(pattern) pattern = pattern.replace('?','\w') words = open('/usr/share/dict/words','r') print '' for word in words: if len(word)== int(length)+1 and re.search(pattern,word): print word.strip() Also made a gui for that application You can get the full source code for this app in  https://github.com/manimaran990/wordpuzzle

Pronunciation script in python

Frequently i had a visits to google to search for some word pronunciations. So I wrote this small script to save my time. you need to install mpg123 before you run this script by $ sudo apt-get install mpg123 spellit.py #!/usr/bin/python import os import sys url = 'http://ssl.gstatic.com/dictionary/static/sounds/de/0/' if len(sys.argv[:]) != 2: print 'usage: ./spellit.py word' exit(0) word = sys.argv[1] final = url+word+'.mp3' os.system('mpg123 -q %s'% final)

Sneak-peek at py-qt

Learned some py-qt to build a front-end for the sms api #!/usr/bin/python import sitsms import sys from PyQt4 import QtGui, QtCore class Sitsms(QtGui.QWidget): def __init__(self): super(Sitsms, self).__init__() self.initUI() def initUI(self): number = QtGui.QLabel("Number ",self) number.move(20,20); message = QtGui.QLabel("Message ",self) message.move(20,60); self.numberEdit = QtGui.QLineEdit(self) self.numberEdit.resize(190,24); self.numberEdit.move(80,20); self.messageEdit = QtGui.QTextEdit(self) self.messageEdit.resize(220,200) self.messageEdit.move(80,60); self.sendbtn = QtGui.QPushButton("send",self) self.sendbtn.setStyleSheet("QPushButton:pressed { background-color: green }" "QPushButton:released { background-color: gray }" ) quitbtn = QtGui.QPushButton("Exit",