Skip to content

Instantly share code, notes, and snippets.

View beers.py
# https://hakibenita.com/fast-load-data-python-postgresql
from typing import Iterator, Dict, Any, Optional
from urllib.parse import urlencode
import datetime
#------------------------ Profile
import time
View pipoint_data_security.py
import sys
import clr
sys.path.append(r'C:\Program Files (x86)\PIPC\AF\PublicAssemblies\4.0')
clr.AddReference('OSIsoft.AFSDK')
from OSIsoft.AF import *
from OSIsoft.AF.PI import *
from OSIsoft.AF.Asset import *
from OSIsoft.AF.Data import *
View PythonistaBackup.py
# coding: utf-8
'''Creates a zip archive of your Pythonista files and serves them via HTTP in your local network.'''
from SimpleHTTPServer import SimpleHTTPRequestHandler
import os
import shutil
import tempfile
import shutil
PORT = 8080
@ThinkCode
ThinkCode / search.py
Created Aug 1, 2011 — forked from GaretJax/search.py
Search for Keyword in Text File and return line number
View search.py
import os, sys
import re, MySQLdb
db = MySQLdb.connect("localhost","testuser","test123","TESTDB" )
#
# MySQL Code
# CREATE TABLE keyword (keywordid integer primary key auto_increment, keyword VARCHAR(255) NOT NULL);
#
# CREATE TABLE location (companyid integer, pdfid integer, keywordid integer references keyword(keywordid),