目录
1、md5
代码:
import hashlib
if __name__ == '__main__':
test = "test MD5"
print(test)
m = hashlib.md5()
m.update(test.encode(encoding='utf-8'))
print(m.hexdigest())
运行结果:
test MD5
212a4c389db4ecfacf61817a711cf892
2、随机数
import random
if __name__ == '__main__':
randNum = random.randint(0,1024)
print(randNum)
3、RTP over RTSP (TCP)
python调用vlc库默认为播放视频为udp容易马赛克,改为tcp效果好很多。
python调用vlc库用RTP over RTSP (TCP)模式播放视频
self.p = vlc.MediaPlayer(rtspAddr,"rtsp-tcp")