-
Open a browser
# start an instance of firefox with selenium-webdriver driver = Selenium::WebDriver.for :firefox # :chrome -> chrome # :ie -> iexplore
- Go to a specified URL
""" | |
Generate PDF reports from data included in several Pandas DataFrames | |
From pbpython.com | |
""" | |
from __future__ import print_function | |
import pandas as pd | |
import numpy as np | |
import argparse | |
from jinja2 import Environment, FileSystemLoader | |
from weasyprint import HTML |
# List unique values in a DataFrame column | |
# h/t @makmanalp for the updated syntax! | |
df['Column Name'].unique() | |
# Convert Series datatype to numeric (will error if column has non-numeric values) | |
# h/t @makmanalp | |
pd.to_numeric(df['Column Name']) | |
# Convert Series datatype to numeric, changing non-numeric values to NaN | |
# h/t @makmanalp for the updated syntax! |
import sys | |
with open(sys.argv[1],"rb") as file: | |
file.seek(0) | |
pdf = file.read() | |
startmark = b"\xff\xd8" | |
startfix = 0 | |
endmark = b"\xff\xd9" | |
endfix = 2 |
import cv2 | |
import numpy as np | |
img = cv2.imread('path/to/img', 0) # 0 = grayscale | |
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
edges = cv2.Canny(img,100,200) | |
lines = cv2.HoughLines(edges,1,np.pi/180,200) | |
for rho, theta in lines[0]: | |
a = np.cos(theta) |
# import the necessary packages | |
from PIL import Image # get image from disk in PIL format | |
import pytesseract # python "wrapper" of Google's Tesseract binaries | |
import argparse # build command-line interfaces | |
import cv2 # opencv-python | |
import os # operating system | |
# construct the argument parse and parse the arguments | |
ap = argparse.ArgumentParser() |
# import packages | |
from PIL import Image | |
import os | |
import argparse # build command-line interfaces | |
# construct the argument parse and parse the arguments | |
ap = argparse.ArgumentParser() | |
ap.add_argument("-d", | |
"--directory", |
import pandas as pd | |
import pyperclip | |
import io | |
def frame_clipboard(): | |
s = pyperclip.paste() | |
clip_df = pd.read_table(io.StringIO(s)) | |
return clip_df |
This configuration worked for me, hope it helps
It is based on: https://becominghuman.ai/deep-learning-gaming-build-with-nvidia-titan-xp-and-macbook-pro-with-thunderbolt2-5ceee7167f8b
and on: https://stackoverflow.com/questions/44744737/tensorflow-mac-os-gpu-support
import pyautogui | |
def mouse_now(): | |
print('Press Ctrl-C to quit.') | |
try: | |
while True: | |
# Get and print the mouse coordinates. | |
x, y = pyautogui.position() | |
positionStr = 'X: ' + str(x).rjust(4) + ' Y: ' + str(y).rjust(4) |