File tree 5 files changed +51
-11
lines changed
5 files changed +51
-11
lines changed Original file line number Diff line number Diff line change @@ -665,17 +665,7 @@ $ faker password
665
665
666
666
## [ GitPython] ( ./other_useful_library/README.md#git )
667
667
668
- ## [ hexbytes] ( https://hexbytes.readthedocs.io/en/stable/ )
669
- 处理字符串和十六进制
670
- ``` python
671
- from hexbytes import HexBytes
672
- HexBytes(b " 123" ) // HexBytes(" 0x313233" )
673
- HexBytes(b " 123" ).hex() // " 0x0123"
674
-
675
- HexBytes(" 123" ) // HexBytes(" 0x0123" )
676
- HexBytes(" 123" ).hex() // " 0x313233"
677
-
678
- ```
668
+ ## [ hexbytes] ( ./other_useful_library/README.md#hexbytes )
679
669
680
670
## [ Humanfriendly] ( ./other_useful_library/README.md )
681
671
转化尺寸
Original file line number Diff line number Diff line change
1
+ ## bitstring
2
+ 转化二进制数据
3
+ ```
4
+ BitArray(HexBytes("0x7f")).int // 127 01111111
5
+ BitArray(HexBytes("0x80")).int // -128 10000000
6
+ ```
7
+
1
8
## [ diff-match-patch] ( https://github.com/google/diff-match-patch )
2
9
用来比较文字的不同
3
10
* 用法
@@ -102,6 +109,20 @@ Humanfriendly.parse_size("10M") // 10_000_000
102
109
Humanfriendly.parse_size("10M", binary=True) // 1024 x 1024 x 10
103
110
```
104
111
112
+ ## [ hexbytes] ( https://hexbytes.readthedocs.io/en/stable/ )
113
+ 处理字符串和十六进制
114
+ ``` python
115
+ from hexbytes import HexBytes
116
+ HexBytes(b " 123" ) // HexBytes(" 0x313233" )
117
+ HexBytes(b " 123" ).hex() // " 0x0123"
118
+
119
+ HexBytes(" 123" ) // HexBytes(" 0x0123" )
120
+ HexBytes(" 123" ).hex() // " 0x313233"
121
+ ```
122
+ * len 2个hex为1个长度
123
+ * slice ` HexBytes("0xffff")[0:1] == HexBytes("0xff") `
124
+ * getitem ` HexBytes("0xffff")[0] == 255 `
125
+
105
126
## [ imapclient] ( imapclient.md )
106
127
很好用的邮件客户端
107
128
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ # Xiang Wang <ramwin@qq.com>
4
+
5
+
6
+ import datetime
7
+ import logging
8
+ import os
9
+ import time
10
+
11
+ from pathlib import Path
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ # Xiang Wang <ramwin@qq.com>
4
+
5
+
6
+ import redis
7
+ from redis import Redis
Original file line number Diff line number Diff line change
1
+ This is the IPython startup directory
2
+
3
+ .py and .ipy files in this directory will be run *prior* to any code or files specified
4
+ via the exec_lines or exec_files configurables whenever you load this profile.
5
+
6
+ Files will be run in lexicographical order, so you can control the execution order of files
7
+ with a prefix, e.g.::
8
+
9
+ 00-first.py
10
+ 50-middle.py
11
+ 99-last.ipy
You can’t perform that action at this time.
0 commit comments