This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, mmap | |
with open(sys.argv[1], 'rb') as src: | |
with open(sys.argv[2], 'wb') as dst: | |
mm = mmap.mmap(src.fileno(), 0, access=mmap.ACCESS_READ) | |
dst.write(mm) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, os | |
with open(sys.argv[1], 'rb') as src: | |
with open(sys.argv[2], 'wb') as dst: | |
size = os.stat(src.fileno()).st_size | |
os.sendfile(dst.fileno(), src.fileno(), 0, size) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/index.rst b/index.rst | |
index f1ae6a9..f682fd6 100644 | |
--- a/index.rst | |
+++ b/index.rst | |
@@ -48,8 +48,7 @@ Compact encoding:: | |
Pretty printing:: | |
>>> import simplejson as json | |
- >>> s = json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4 * ' ') | |
- >>> print('\n'.join([l.rstrip() for l in s.splitlines()])) |