Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| import re | |
| import PyPDF2 | |
| import os | |
| import datetime | |
| def get_invoice_id(invoice_path): | |
| '''Finds the invoice ID in the first page of the invoice''' | |
| pdf_reader = PyPDF2.PdfReader(invoice_path) | |
| page_text = pdf_reader.pages[0].extract_text() |
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
| import re | |
| email = 'test@example.com' | |
| pattern = r'^[^@]+' | |
| match = re.search(pattern, email) | |
| if match: | |
| username = match.group() | |
| 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
| import PyPDF2 | |
| reader1 = PyPDF2.PdfReader('Front Sides.pdf') | |
| reader2 = PyPDF2.PdfReader('Back Sides.pdf') | |
| writer = PyPDF2.PdfWriter() | |
| total_pages1 = len(reader1.pages) | |
| total_pages2 = len(reader2.pages) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| import csv | |
| import sys | |
| import os | |
| # Get file_name from user, add .csv if not included | |
| if len(sys.argv) == 1: | |
| file_name = input('Enter the name of the file you would like to divide up: ') | |
| else: | |
| file_name = sys.argv[1] |
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
| from pathlib import Path | |
| # pip install PySimpleGUI | |
| import PySimpleGUI as sg | |
| # pip install pandas | |
| import pandas as pd | |
| # Open Excel file | |
| current_dir = Path(__file__).parent if '__file__' in locals() else Path.cwd() | |
| EXCEL_FILE = current_dir / 'Data_Entry.xlsx' |
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
| # pip3 install pandas | |
| import pandas as pd | |
| import os | |
| # Read in data from all .csv files in folder | |
| DIRECTORY = input('What is the name of the folder with the Excel files?') | |
| # Iterate over all files in that folder | |
| for filename in os.listdir(DIRECTORY): | |
| f = os.path.join(DIRECTORY, filename) |
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
| import os | |
| folder = "data folder" | |
| for count, filename in enumerate(os.listdir('./data folder')): | |
| new_filename = f"{folder}/Datafile {count} 5-10-22.txt" | |
| source =f"{folder}/{filename}" | |
| os.rename(source, new_filename) |
NewerOlder