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
# Month of the year -- Table 1 | |
month1 = 'January' | |
month2 = 'February' | |
month3 = 'March' | |
month4 = 'April' | |
month5 = 'May' | |
month6 = 'June' | |
month7 = 'July' | |
month8 = 'August' | |
month9 = 'September' |
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
def count_substring(string, sub_string): | |
count = 0 | |
for i, value in enumerate(string): | |
if string[i:i+len(sub_string)] == sub_string: | |
count += 1 | |
return count | |
#print("match at string[" + str(i) + "]") | |
if __name__ == '__main__': |
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
n = int(input()) | |
s = set(map(int, input().split())) | |
N = int(input()) | |
for i in range(N): | |
cmd=input().split() | |
if cmd[0]=="pop": | |
s.pop() | |
else: | |
s.cmd[0](int(cmd[1])) |
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
#!python3 | |
import requests as req | |
import re | |
first_names_m = [] | |
first_names_f = [] | |
last_names = [] | |
# Get the raw page data into usable text format # | |
js = req.get('https://www.fantasynamegenerators.com/scripts/russianNames.js') |
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 mechanize | |
# DEFINE PRINTER NAMES, IPs, AND DEFAULT STATUS (FALSE) | |
# FUTURE VERSION WILL REFERENCE EXCEL SHEET FOR PRINTER IPS FOR SCALABILITY | |
printers = [ | |
{'name': 'N1', 'ip': '10.3.16.32', 'status': 0}, | |
{'name': 'N2', 'ip': '10.3.8.30', 'status': 0}, | |
{'name': 'P1', 'ip': '10.3.16.31', 'status': 0}, | |
{'name': 'P3', 'ip': '10.3.16.30', 'status': 0} | |
] |
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
Assign user-provided era to global variable | |
Filter lists: | |
wordAgeList - filter relative-modern words to relModWords list | |
idiomAgeList - filter relative-modern phrases to relModIdiom list | |
idiomAgeList - filter relative-old phrases to relOldIdiom list | |
# later user option to allow older idioms, user option to specify age of idioms to allow | |
commonWordList - filter relative modern words to relModWords list (same list as above) | |
commonWordList - filter contemporary words to contempCom list |
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 twitter | |
api = twitter.Api(consumer_key=[consumer key], | |
consumer_secret=[consumer secret], | |
access_token_key=[access token], | |
access_token_secret=[access token secret]) | |
status = api.PostUpdate('@madsc13ntist I\'m callin\' you out!') | |
print(status.text) |
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 Tkinter as tk | |
import random | |
import string | |
root = tk.Tk() | |
frame = tk.Frame(root) | |
frame.pack() | |
# Data pile | |
about_txt = "This is where the about stuff goes..." |
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
# practicepython.org Ex 08 | |
import getpass as g | |
import string | |
def crush(word): # Removes all variables from input text for maximum ease of parsing. | |
word = word.replace(" ", "") # Removes spaces. | |
word = string.lower(word) # Changes all letters to lowercase. | |
for c in word: | |
if c in string.punctuation: |
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
# practicepython.org Ex 06 | |
import string | |
word = raw_input("Palindrome checker. Enter your palindrome: ") | |
#print word | |
word = word.replace(" ", "") # Removes spaces. | |
#print word |
NewerOlder