This file contains 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 logging | |
import tweepy | |
logger = logging.getLogger() | |
logger.addHandler(logging.FileHandler('test.log')) | |
logger.setLevel(logging.DEBUG) | |
auth = tweepy.OAuthHandler( | |
'API Key', |
This file contains 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
from __future__ import print_function | |
import json | |
import logging | |
import sys | |
import tweepy | |
from datetime import datetime, timedelta |
This file contains 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
list_one = [1,1,1] | |
list_two = [2,2,2] | |
list_three = [3,3,3] | |
t_list = [list_one, list_two, list_one, list_one, list_three] | |
one_list = [list_one, list_one, list_one] |
This file contains 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
>>> class Foo(object): | |
... def bar(self): | |
... print('Foo-y bar') | |
... | |
>>> class Bar(Foo): | |
... def __init__(self): | |
... super(Bar, self).bar() | |
... super(Foo, self).bar() | |
... def bar(self): | |
... print('Bar bar jinks') |
This file contains 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
from flask import Flask, redirect, url_for, render_template | |
app = Flask(__name__) | |
def get_light_states(): | |
return 'blue', 'no yellowwwww!' | |
@app.route('/') |
This file contains 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 os | |
import tempfile | |
with tempfile.NamedTemporaryFile() as f: | |
filename = f.name | |
# Technically that already opens a file, but I want to be explicit about | |
# open | |
handle_one = open(filename, 'w+') |
This file contains 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
from __future__ import print_function | |
import json | |
import logging | |
import os | |
import sys | |
import tweepy | |
from datetime import datetime, timedelta |
This file contains 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
BEGIN:VCALENDAR | |
METHOD:CANCEL | |
PRODID:Microsoft Exchange Server 2010 | |
VERSION:2.0 | |
BEGIN:VTIMEZONE | |
TZID:Eastern Standard Time | |
BEGIN:STANDARD | |
DTSTART:16010101T020000 | |
TZOFFSETFROM:-0400 | |
TZOFFSETTO:-0500 |
This file contains 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
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
NameError: name 'k' is not defined | |
This file contains 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 matplotlib.pyplot as plt | |
def fnord(): | |
data = [1,2,3] | |
import pdb; pdb.set_trace() | |
plt.plot(data) | |
plt.show() | |