Skip to content

Commit

Permalink
upload a script
Browse files Browse the repository at this point in the history
  • Loading branch information
livc committed Aug 29, 2016
1 parent 15d007f commit 8ea6047
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions add.py
@@ -0,0 +1,17 @@
# encoding: utf-8
import json
import codecs
import base64
import sys

S1 = sys.argv[1]
for i in range(2, len(sys.argv)):
S2 = sys.argv[i]
with codecs.open('groups.json', 'r+', encoding='utf-8') as f:
data = json.load(f)
S2 = base64.b64encode(S2)
data[S1.decode('utf-8')].append({'TEXT':S2})
f.seek(0)
json.dump(data, f, indent=4, ensure_ascii=False)

print 'success!'

0 comments on commit 8ea6047

Please sign in to comment.