Skip to content

Instantly share code, notes, and snippets.

@hollastic
hollastic / runall.py
Created January 29, 2013 09:17 — forked from antlypls/runall.py
Python: runall files in a dir
import os
path = os.getcwd()
for root, dirs, files in os.walk(path):
print("visiting: ", root)
os.chdir(root)
py_files = [file for file in files if file[-3:]=='.py']
for py_file in py_files:
cmd = "python {0}".format(py_file)
print("running: ", cmd)
@hollastic
hollastic / .py
Created January 29, 2013 09:13 — forked from 0xnbk/.py
Python: twitter follower filter
import twitter, sys, getpass, os
def call_api(username,password):
api = twitter.Api(username,password)
friends = api.GetFriends()
followers = api.GetFollowers()
heathens = filter(lambda x: x not in followers,friends)
print "There are %i people you follow who do not follow you:" % len(heathens)
for heathen in heathens:
print heathen.screen_name