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 sys | |
import os | |
import sqlite3 | |
from ipaddress import IPv4Network | |
from socket import inet_ntoa, inet_aton | |
from struct import pack, unpack | |
def ip2long(ip_addr): | |
return unpack("!L", inet_aton(ip_addr))[0] |
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 win32com.client as c | |
wordApp = c.gencache.EnsureDispatch('Word.Application') | |
wordApp.Visible = True | |
path = r'<DOC_PATH_HERE>' | |
doc = wordApp.Documents.Open(path) | |
for tbl in doc.Tables: |
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
cd ~/osoyoo-robot/cam-robot/mjpg-streamer/ | |
sudo ./start.sh | |
sudo webiopi -d -c /etc/webiopi/config | |
Then navigate to http:10.11.12.122:8000 |
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
set cli pager off | |
set cli config-output-format set | |
configure | |
show |
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 win32com.client as c | |
class VisioDrawing: | |
def __init__(self, path, pageName): | |
self.path = path | |
self.vsdApp = c.gencache.EnsureDispatch('Visio.Application') | |
self.vsdApp.Visible = True | |
self.vsd = self.vsdApp.Documents.Open(path) |
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 win32com.client as c | |
from jinja2 import FileSystemLoader, Environment, Template | |
xlApp = c.gencache.EnsureDispatch('Excel.Application') | |
xlApp.Visible = True | |
path = r'path.xlsx' | |
wk = xlApp.Workbooks.Open(path) | |
sh = wk.Worksheets('Sheet1 (2)') |
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 win32com.client as c | |
subs = """ | |
One|1 | |
Two|2 | |
""".splitlines() | |
subs = {k: v for k, v in [y.split('|') for y in subs if len(y) > 0]} | |
xlApp = c.gencache.EnsureDispatch('Excel.Application') |
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
# coding: utf-8 | |
import os | |
import sys | |
import pprint | |
import win32com.client | |
import yaml | |
def pretty_printer(o): |
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 win32com.client as c | |
import pprint | |
import re | |
class Util: | |
@staticmethod | |
def pretty_printer(o): | |
pp = pprint.PrettyPrinter(indent=4) | |
pp.pprint(o) |
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 | |
rex = re.compile(r'([A-Za-z ]+)(?:[\., ]+)?([pPaAgGeE]{4},?(?:[\., ])?\d\d?\d?)') | |
# Info below comes from Otter text export (no reader ID, no timestamp) | |
# Topics are read out and then Page Number are read at the end | |
# Does reasonable job | |
data = """ | |
ICS concepts. |