This file contains 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
>>> 'あいう' | |
'\xe3\x81\x82\xe3\x81\x84\xe3\x81\x86' |
This file contains 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 pprint | |
import json | |
import corenlp | |
# パーサの生成 | |
corenlp_dir = "/usr/local/lib/stanford-corenlp-full-2013-06-20/" | |
parser = corenlp.StanfordCoreNLP(corenlp_path=corenlp_dir) | |
# パースして結果をpretty print | |
result_json = json.loads(parser.parse("I am Alice.")) |
This file contains 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
$ pip install xlsxwriter |
This file contains 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
Show hidden characters
[ | |
{ | |
"keys": ["command+_"], | |
"command": "run_emmet_action", | |
"args": { | |
"action": "merge_lines" | |
} | |
} | |
] |
This file contains 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
$ python hello.py |
This file contains 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
sql_stmt = "CREATE TABLE Test(" \ | |
"id INTEGER PRIMARY KEY, " \ | |
"val TEXT NOT NULL)" |
This file contains 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
# -*- coding: utf-8 -*- | |
# stdlib | |
import cPickle as pickle | |
import zlib | |
PROTOCOL = pickle.HIGHEST_PROTOCOL | |
def save_to_str(obj): |
This file contains 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
# -*- coding: utf-8 -*- | |
# stdlib | |
import re | |
import datetime | |
# thirdlib | |
from dateutil.parser import parse | |
MONTHS = ( | |
"January", | |
"February", |
This file contains 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
# -*- coding: utf-8 -*- | |
# stdlib | |
import sys | |
import traceback | |
def print_exception(func, log_file=sys.stderr): | |
u""" | |
関数実行中に発生した例外を出力 | |
""" |
This file contains 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
# -*- coding: utf-8 -*- | |
# stdlib | |
import re | |
LEFT_SPACES = re.compile(r'\s+<') | |
RIGHT_SPACES = re.compile(r'>\s+') | |
SCRIPT_TAG = re.compile(r'<script[^>]*>.*?</script>') | |
COMMENT = re.compile(r'<!--[\s\S]*?-->') |
OlderNewer