robocopy <source folder> <destination archive> /e /z /r:1 /w:1
Where:
- /e recurses
- /z allows you to restart copy from last time
- /r:1 retries set to 1
import os | |
import win32com.client | |
import re | |
import pprint | |
def pretty_print(o): | |
pp = pprint.PrettyPrinter(indent=4) | |
pp.pprint(o) |
abbrevs = [ | |
'STP', | |
'TCP', | |
'TI', | |
'USB', | |
'UTP', | |
'VLAN', | |
'VLANs', | |
'VM', | |
'VMs', |
.DS_Store |
#1 import these classes from jinja2 module | |
from jinja2 import FileSystemLoader, Environment, Template | |
from pathlib import Path | |
from enum import Enum | |
import re, sys, os | |
port_data = """ | |
Gi2/0/23|Gi2/0/23: Desc1|130 | |
Gi2/0/21|Gi2/0/21: Desc2|120 |
%w(pp win32ole).each {|dep| require dep} | |
begin | |
$app = WIN32OLE.connect('Word.Application') | |
rescue Exception => e | |
$app = WIN32OLE.new('Word.Application') | |
end | |
$app.Visible = true | |
class WordConst |
Jim is my enemy - but it turns out that Jim is also his own worst enemy - and the enemy of my enemy is my friend - so Jim is actually my friend - but - because he is his own worst enemy - the enemy of my friend is my enemy - so Jim is actually my enemy - but...
%w(pp win32ole).each { |dep| require dep } | |
db = 'C:\Users\rdapaz\Documents\Statement of Compliance.accdb' | |
cs = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=#{db};" | |
rs = WIN32OLE.new('ADODB.Recordset') | |
conn = WIN32OLE.new('ADODB.Connection') | |
conn.Open(cs) | |
rs.Open("[SoC]", conn, 1, 3) | |
conn.Execute("DELETE * FROM SoC") |
# AFQ210311450994 | |
import re | |
import win32com.client as w32 | |
path = r'<path goes here>' | |
wdApp = w32.gencache.EnsureDispatch('Word.Application') | |
wdApp.Visible = True | |
doc = wdApp.Documents.Open(path) |
def strHex(s): | |
return f"0x%0.2X" % s | |
strHex(3) |