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 python3 | |
import pyautogui | |
import time | |
import sys | |
import os | |
print('Press Ctrl + C to stop mouse from moving around.') | |
# Time delay between mouse movement | |
delay = 10 |
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 python3 | |
# Scans through your email account, | |
# find all the unsubscribe links in all your emails, | |
# and automatically opens them in a browser. | |
# This program will have to log in to your email provider's IMAP server | |
# and download all of your emails. | |
# You can use BeautifulSoup to check for any instance | |
# where the word unsubscribe occurs within an HTML link tag. |
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 python3 | |
# This program opens a spreadsheet and write the cells of column A into one text file, the cells of column B into another text file, and so on. | |
import openpyxl, os | |
wb = openpyxl.load_workbook('allInOne.xlsx') | |
sheet = wb.active | |
# Loop through each column |
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 python3 | |
# This program reads in the contents of several text files and inserts those contents into a spreadsheet, with one line of text per row. | |
# The lines of the first text file will be in the cells of column A. | |
# The lines of the second text file will be in the cells of column B, and so on. | |
import openpyxl | |
from openpyxl.utils import get_column_letter | |
# Create a new spreadsheet |
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 python3 | |
# This program inverts the row and column of the cells in the spreadsheet. | |
import sys, openpyxl | |
from openpyxl.utils import get_column_letter | |
fileName = 'somefile.xlsx' | |
wb = openpyxl.load_workbook(fileName) | |
sheet = wb.active |
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 python3 | |
# This program takes two integers and a filename string as command line arguments. | |
# Let's call the first integer N and the second integer M. | |
# Starting at row N, the program should insert M blank rows into the spreadsheet. | |
import sys, openpyxl | |
from openpyxl.utils import get_column_letter | |
if len(sys.argv) > 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
#!/usr/bin/env python3 | |
# This program takes a number N from the command line | |
# and creates an N by N multiplication table in an Excel spreadsheet. | |
import sys, openpyxl | |
from openpyxl.styles import Font | |
from openpyxl.utils import get_column_letter, column_index_from_string | |
# Default n is 6 |
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 python3 | |
# The shuffle must be "uniform," meaning each item in the original list must have the same probability of ending up in each spot in the final list. | |
# Assume that you have a function get_random(floor, ceiling) for getting a random integer that is >= floor and <= ceiling. | |
import random | |
myList = [12, 7, 9, 10, 4] | |
for i in range(len(myList)-1, 0, -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
#!/usr/bin/env python3 | |
# Write a program that finds all files with a given prefix, such as spam001.txt, spam002.txt, and so no, in a single folder | |
# and locates any gaps in the numbering (such as if there is a spam001.txt and spam003.txt but no spam002.txt). | |
# Have the program rename all the later files to close this gap. | |
import os, shutil | |
def fillInGaps(folder, prefix): | |
folder = os.path.abspath(folder) |
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 python3 | |
# Write a program that finds all files with a given prefix, such as spam001.txt, spam002.txt, and so no, in a single folder | |
# and locates any gaps in the numbering (such as if there is a spam001.txt and spam003.txt but no spam002.txt). | |
# Have the program that can insert gaps into numbered files so that a new file can be added. | |
import os | |
def fillInGapsWithNewFiles(folder, prefix): | |
folder = os.path.abspath(folder) |