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
# open twain.txt, "copy" the data into 'text', then close the file. | |
def words_counted(): | |
text ='' | |
f = open('twain.txt') | |
for line in f: | |
newline = line.strip() | |
text += ' '+ newline | |
f.close() | |
text = text.split(' ') # define 'text' as the file 'text' split by spaces |
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
#!/usr/bin/env python | |
import os | |
import random | |
import time | |
import platform | |
snowflakes = {} | |
try: | |
# Windows Support |
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
@blueprint.route('/register', methods=['GET','POST']) | |
def register(): | |
if request.method == 'GET': | |
return render_template('influencer/register.jt') | |
data = request.form.to_dict() | |
# pass data to validation lib to be validated | |
result = v.influencer_register(data) | |
if result.is_valid(): | |
#check for duplicate | |
active_influencer = get_influencer_by_email(result.get_value('email')) |
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 requests | |
class HTTPMethod: | |
GET = 1 | |
POST = 2 | |
PUT = 3 | |
DELETE = 4 | |
class NSAPI: | |
""" Class that talks to Service Catalog via NS API """ |
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 sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy import create_engine | |
from sqlalchemy import Column, Integer, String, DateTime, ForeignKey | |
from sqlalchemy.orm import sessionmaker, relationship, backref, scoped_session | |
from flask.views import MethodView | |
USER_COLS = ["id", "email", "password", "age"] | |
engine = create_engine("sqlite:///ratings.db", echo=True) |
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
# 1234 837 654 95 67 21 | |
# 1234 83 7654 9 567 21 | |
Def inner_matrix(side, rows): | |
If not side: | |
For r in rows: | |
print(rows[-1]) | |
rows.pop() | |
Else: |