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
This is stuff that I've typed into a file. | |
It's really cool stuff. | |
Lots and lots of fun to have in here. |
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
#!/bin/python3 | |
# For this example, when you repeat it for the second time in the console, you need | |
# to put the name of the file in quotes "" so it sees it as a string. | |
# http://goo.gl/JiVv8q | |
# TODO comment each line in this script | |
__author__ = 'Ernest' | |
from sys import argv |
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
#!/bin/python3 | |
# __author__ = 'Ernest' | |
# | |
# # Prompting and Passing | |
# | |
# from sys import argv | |
# | |
# script, user_name = argv | |
# prompt = '> ' | |
# |
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
__author__ = 'Ernest' | |
# http://goo.gl/TTWavf this tutorial on the mouse vs python | |
# http://goo.gl/bmovjk python 3 urllib import | |
# C:\Users\ernest\Downloads\blog.pythonlibrary.org-Using pyGal Graphs in Flask.pdf | |
# API 0d334d714fe6b157 | |
import pygal | |
import json | |
import requests |
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
__author__ = 'Ernest' | |
# http://goo.gl/Yksyj8 | |
import os | |
directory = 'D:\\Dropbox\\www\\boilerplates\\testdir' | |
find = "foobar" | |
replace = "foobar" | |
# walk through the directory from bottom up |
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
i = 0 | |
for i in range (1, 101): | |
if i % 3 == 0 and i % 5 == 0: | |
print "FIZZ BUZZ" | |
elif i % 3 == 0: | |
print "FIZZ" | |
elif i % 5 == 0: | |
print "BUZZ" | |
else: |
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
__author__ = 'Ernest' | |
# create a list with [] or () | |
empty_list = [] | |
weekdays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'] | |
# convert the data types to a list | |
list('cats') | |
a_tuple = ['ready', 'fire', 'aim'] |
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
#!/usr/bin/python | |
# encoding: utf-8 | |
""" | |
Created: 08/04/15, 12:32 | |
Description: | |
""" | |
import os | |
# The top argument for walking a directory | |
topdir = '.' |
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
__author__ = 'Ernest' | |
# Material from chapter 2 of Introduction to python | |
# to save a session from the console in ipython use the following | |
# command - %save my_session 1-20 | |
# where %save is teh save command, my_session is the file name | |
# and 1-20 are the lines that you want to save. | |
# this data has been added to github as a new repo | |
# and this line | |
letters = 'abcdefghijklmnopqrstuvwxyz' |
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
# coding: utf-8 | |
letters = 'abcdefghijklmnopqrstuvwxyz' | |
letters[:] | |
letters[20:] | |
letters[10:] | |
letters[12:15] | |
letters[-3:] | |
letters[18:-3] | |
letters[-6:-2] | |
letters[::7] |