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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# ファイルとサブディレクトリのパスを表示 | |
MUSIC_PATH = u"/Users/USERNAME/Music/iTunes/iTunes Media/Music" | |
import glob | |
import os | |
from unicodedata import normalize | |
from subprocess import call |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import urllib2 | |
import json | |
API_KEY = "" | |
class GoogleURLShorter(object): | |
def __init__(self, target_url, api_key=""): | |
self.baseUrl = 'https://www.googleapis.com/urlshortener/v1/url' |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# お題: 時間帯重複チェック(応用編) | |
def CheckIfSyntax(*timeTuple): | |
for i in xrange(len(timeTuple)): | |
(timeStartHour, timeStartMin, timeEndHour, timeEndMin) = timeTuple[i] | |
# 時間の書式のチェック | |
if timeStartHour > 24 or timeEndHour > 24 \ |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import math | |
N = 10000 | |
def main(): | |
numList = range(1, N + 1) | |
# 1を除く | |
numList.pop(0) |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# お題: 時間帯重複チェック | |
def checkIfSyntax(time1, time2): | |
""" | |
>>> checkIfSyntax((-2,3,1,1,), (1,1,1,1)) | |
Traceback (most recent call last): | |
... |
NewerOlder