Skip to content

Instantly share code, notes, and snippets.

View seozed's full-sized avatar
🌴
On vacation

zed seozed

🌴
On vacation
View GitHub Profile
@seozed
seozed / diff string.py
Created November 8, 2017 07:33
比较字符串差异
from difflib import SequenceMatcher
def similar(a, b):
return SequenceMatcher(None, a, b).ratio()
"""
>>> similar("Apple","Appel")
0.8
>>> similar("Apple","Mango")
0.0
@seozed
seozed / get random string.py
Last active October 19, 2017 03:02
生成随机字符串的方法
import string
import random
# python 3.6.1以下
text = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(15))
print(text)
# python 3.6.1
text = ''.join(random.choices(string.ascii_letters + string.digits, k=15))
@seozed
seozed / csharp.cs
Last active January 10, 2020 07:12
C# 笔记
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.IO;
namespace ConsoleApp1
{
@seozed
seozed / vi.md
Created March 9, 2017 08:11
vi笔记
  1. 全局替换字符串 %s#old string#new string#g