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
#Python 3 | |
#CombinePDF.py | |
#Gets inputs of 2 PDF file names from user and combines them into 1 | |
import PyPDF2 | |
import os | |
def getFileNameFromUser (file): | |
pdf_file_name = input("Enter {0} name: ".format(file)) | |
if pdf_file_name in os.listdir(): |
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
#python 3 | |
#Read the list of names and email ids from an excel file and populate them in a text file | |
import openpyxl | |
import os | |
import time | |
def fetchUnpaidMembers(max_row, max_col, sheet): | |
member_count = 0 | |
mydict = {} |
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
# Python 3.4 | |
import os | |
# Windows uses backward slash; Mac & Linux uses forward slash | |
# But python will always recognise forward slash | |
# Python recognises everything as a sequence of unicode characters (string) | |
# Computer manages directories as a sequence of bytes (byte stream)\ | |
# To read or write unicode characters from byte stream, encoding is required | |
# Different OS use different methods for encoding |
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
# python 3 | |
# shopper.py | |
''' | |
This is a very simple and effective program. | |
Open multiple shopping sites for one search parameter at one go | |
Search for a product term as a command prompt argument | |
Multiple words separated by space is fine | |
e.g. shooper.py iphone 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
# RestfulPostClient.py | |
# Python 2.7.6 | |
import requests | |
from requests.auth import HTTPDigestAuth | |
# import json # Json module is not required as we are directly passing json to requests | |
# Replace with the correct URL | |
url = "http://api_url" |
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
# getHttpHeader.py | |
# Python 2.7.6 | |
import requests | |
from requests.auth import HTTPDigestAuth | |
import getpass # To mask the password typed in | |
# Replace with the correct URL | |
url = "http://some_url" |
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
# fileExplorer.py | |
# python 2.7.6 | |
import os | |
# defaultdict is used to have keys created if it doesn't exist or appended it if exists | |
from collections import defaultdict | |
folder_count = 0 | |
file_count = 0 | |
loop_count = 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
# python 2.7.6. | |
# portScanner.py | |
import socket | |
from datetime import datetime | |
import sys | |
# Here we are scanning your own terminal | |
# Replace this with gethostbyname("host") to scan a remote host |
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
# Python 2.7.6 | |
# timeZoneExplorer.py | |
from pytz import timezone, common_timezones # import all_timezones for more exhaustive list | |
from datetime import datetime | |
import os | |
# Log file will be created in the same folder as the python script | |
my_path = "." | |
log_path = os.path.join(my_path + "/" + "loc_log.txt") |
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
# jsonToCSV.py | |
# Python 2.7.6 | |
''' | |
Place all the json payloads as separate text files in base folder | |
Program will extract each payload and generate single csv file | |
csv file will have key value pairs in separate columns | |
''' | |
import json |
OlderNewer