puts 'The best way to log and share programmers knowledge.'
puts 'The best way to log and share programmers knowledge.'
また、コードをインライン表示することも可能です。
>>> import dateutil.parser | |
>>> print dateutil.parser.parse('Oct 3 12:00:00') | |
2014-10-03 12:00:00 | |
>>> type(dateutil.parser.parse('Oct 3 12:00:00')) | |
<type 'datetime.datetime'> |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
csvから文字列を探して位置を返す | |
# 入力形式. csvが渡されることを想定 | |
"Z","T","A","V", | |
"P","G","P","N", | |
# 出力形式 |
for i=1, 100 do | |
if i%3 == 0 and i%5 == 0 then | |
print(fizzbuzz') | |
elseif %3 == 0 then | |
print('fizz') | |
elseif i%5 == 0 then | |
print('buzz') | |
else | |
print(i) | |
end |
| static/ | |
| | | css/ | |
| | | fonts/ | |
| | | images/ | |
| | | js/ | |
| | | movies/ | |
| browser_scripts/ # js | |
| data/ | |
| scripts/ # wsgi | |
| submodule/ |
# coding: utf-8 | |
""" | |
ハンバーガーショップの合計金額計算 | |
""" | |
import sys | |
from collections import defaultdict | |
######## | |
# マスターデータ定義クラス群 |
def trim_duplicate_by_objects_list(objects_list, obj_attr_name): | |
trimd = {} | |
for o in objects_list: | |
key = getattr(o, obj_attr_name) | |
if not key: | |
continue | |
trimd[key] = o | |
return trimd.values() |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
""" | |
class BaseRule(object): | |
def __init__(self, cell): | |
self.cell = cell | |
def valid(): | |
raise NotImplementedError |
fork したものを写経してみた。 | |
割とtypoしててびびった。 |