This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import twitter | |
client=twitter.Api() | |
def view_status (): | |
username= raw_input('Enter the username:') | |
latest=client.GetUserTimeline(username) | |
print [s.text for s in latest] | |
def update_status (): | |
username= raw_input('Enter the username:') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PROGRAM TO GENERATE HYPER-LINKED TAG CLOUD # | |
# Run at command line with three parameters | |
# Source File | |
# Noise File | |
# No.of Tags to Generate | |
import string,sys,os,webbrowser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string,sys | |
f1=open(sys.argv[1]) | |
f2=open(sys.argv[2]) | |
try: | |
count=int(sys.argv[3]) | |
except IndexError: | |
count=20 | |
content= string.lower(f1.read()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string,sys | |
f1=open(sys.argv[1]) | |
f2=open(sys.argv[2]) | |
content= string.lower(f1.read()) | |
noisecontent= string.lower(f2.read()) | |
workinglist =string.split(content) | |
cleanlist =[] | |
for item in workinglist: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string,sys | |
f1=open(sys.argv[1]) | |
f2=open(sys.argv[2]) | |
content= string.lower(f1.read()) | |
noisecontent= string.lower(f2.read()) | |
workinglist =string.split(content) | |
cleanlist =[] | |
for item in workinglist: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string,sys | |
f=open(sys.argv[1]) | |
content= string.lower(f.read()) | |
workinglist =string.split(content) | |
cleanlist =[] | |
for item in workinglist: | |
temp=item.strip(string.punctuation) | |
cleanlist=cleanlist+[temp,] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import shlex | |
import string | |
f=open(sys.argv[1]) | |
content=f.read() | |
sen=string.split(content,'.') | |
print sen | |
words=[] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import shlex | |
f=open(sys.argv[1]) | |
content=f.read() | |
words=shlex.split(content) | |
print 'word count = '+ str(len(words)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from string import split | |
f=open(sys.argv[1]) | |
content=f.read() | |
#print content | |
sentence=split(content,'.') | |
largest=smallest=len(sentence[0]) | |
total=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from string import split | |
f=open(sys.argv[1]) | |
content=f.read() | |
print content | |
print 'the no.of sentences in file = '+ str(len(split(content,'.'))-1) | |
# we sub 1 is because split creates a null element after the last '.' |
NewerOlder