hex <-> str in python
str to hex:
import codecs
hexlify = codecs.getencoder('hex')
hexlify(b'Blaah')[0]
out:
b'426c616168'
hex to str:
import codecs
decode_hex = codecs.getdecoder("hex_codec")
s = decode_hex(b'426c616168')[0]
out:
b'Blaah'
str to hex:
import codecs
hexlify = codecs.getencoder('hex')
hexlify(b'Blaah')[0]
out:
b'426c616168'
hex to str:
import codecs
decode_hex = codecs.getdecoder("hex_codec")
s = decode_hex(b'426c616168')[0]
out:
b'Blaah'
https://docs.python.org/3/library/winreg.html#
https://stackoverflow.com/questions/15128225/python-script-to-read-and-write-a-path-to-registry
import winreg
REG_PATH = r"Control Panel\Mouse"
def set_reg(name, value):
try:
winreg.CreateKey(winreg.HKEY_CURRENT_USER, REG_PATH)
registry_key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, REG_PATH, 0,
winreg.KEY_WRITE)
winreg.SetValueEx(registry_key, name, 0, winreg.REG_SZ, value)
winreg.CloseKey(registry_key)
return True
except WindowsError:
return False
def get_reg(name):
try:
registry_key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, REG_PATH, 0,
winreg.KEY_READ)
value, regtype = winreg.QueryValueEx(registry_key, name)
winreg.CloseKey(registry_key)
return value
except WindowsError:
return None
#Example MouseSensitivity
#Read value
print (get_reg('MouseSensitivity'))
#Set Value 1/20 (will just write the value to reg, the changed mouse val requires a win re-log to apply*)
set_reg('MouseSensitivity', str(10))
#*For instant apply of SystemParameters like the mouse speed on-write, you can use win32gui/SPI
#http://docs.activestate.com/activepython/3.4/pywin32/win32gui__SystemParametersInfo_meth.html
安装:https://pypi.org/project/opencv-python/
使用:https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_setup/py_table_of_contents_setup/py_table_of_contents_setup.html
示例:https://www.askaswiss.com/2016/01/how-to-create-pencil-sketch-opencv-python.html
打包 exe:https://pypi.org/project/auto-py-to-exe/
macOS 中如果安装一些修改版或破解版软件,通过拖拽方式放到 application 目录,在打开 app 的时候可能提示程序无法运行,通常我们在系统 preference - security 里可以手动允许运行,但是有时候使用这种方法也无法打开,这是由于系统识别到这个 app 可能有问题所以给它加上了 com.apple.quarantine
隔离属性阻止了他的运行。
如果我们需要运行它,就需要删除 app 的 com.apple.quarantine
属性,可以使用 xattr
来处理。
1 | 视角移动 |
2 | 视野放大/缩小 |
3 | 视角旋转 |
E | object 移动 |
R | object 旋转 |
T | object 放大/缩小 |
object 编辑 | |
U | 线段功能菜单 |
U + L | 选择闭合曲线 |
U + U | 取消区域曲线选择 |
M | 块功能菜单 |
M + T | 块生成工具 |
Q | 隐藏 subdivision surface |
alt + R | 区域渲染 |