Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

sinchan sinchantsao

🎯
Focusing
View GitHub Profile
@sinchantsao
sinchantsao / depressZipFile.py
Last active Dec 6, 2019
解决zipfile解压中文压缩包乱码问题,以及文件加密判断,这里只做解压乱码的问题处理,未实现加密文件解压
View depressZipFile.py
# coding=utf8
# !/usr/bin/python2.7
import chardet
import os
import zipfile
def decompressChar(string, encode=None):
try:
if isinstance(string, unicode):
@sinchantsao
sinchantsao / round.py
Last active Jan 17, 2021
how to round to 2 decimal ignoring any shit storage method in disk
View round.py
"""
>>> round(2.5)
2
>>> round(3.5)
4
>>> round(4.5)
4
>>> round(1.555, 2)
1.55
>>> round(1.556, 2)