equal
deleted
inserted
replaced
1 $ cat > writelines.py <<EOF |
1 $ cat > writelines.py <<EOF |
2 > import sys |
2 > import sys |
3 > if sys.version_info[0] >= 3: |
3 > encode = lambda x: x.encode('utf-8').decode('unicode_escape').encode('utf-8') |
4 > encode = lambda x: x.encode('utf-8').decode('unicode_escape').encode('utf-8') |
|
5 > else: |
|
6 > encode = lambda x: x.decode('string_escape') |
|
7 > path = sys.argv[1] |
4 > path = sys.argv[1] |
8 > args = sys.argv[2:] |
5 > args = sys.argv[2:] |
9 > assert (len(args) % 2) == 0 |
6 > assert (len(args) % 2) == 0 |
10 > |
7 > |
11 > f = open(path, 'wb') |
8 > f = open(path, 'wb') |