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 -*- | |
import datetime | |
import sys | |
try: | |
g, y, m, d = sys.argv | |
except: | |
exit() | |
try: | |
t = datetime.date(int(y), int(m), int(d)) | |
try: |
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 -*- | |
import tweepy | |
import sqlite3 | |
import os | |
import time | |
if __name__ == "__main__": | |
auth = tweepy.OAuthHandler(CK, CS) | |
auth.set_access_token(AK, AS) | |
api = tweepy.API(auth) | |
path1 = os.path.isfile("followers.db") |
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 -*- | |
import requests | |
import json | |
import re | |
import sys | |
print u"このプログラムは横浜市資源循環局のイーオくんとお話できるプログラムだよ" | |
print u"終了したいときは[Ctrl+C]を押すか[/exit]と送ってね" | |
print u"---" * 20 | |
print u"イーオだよ。こんにちは。" | |
print 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 -*- | |
import sqlite3 | |
con = sqlite3.connect("") # dbname | |
conn = con.cursor() | |
conn.row_factory = sqlite3.Row | |
ret = conn.execute("select * from # order by #") # 1つ目の#: tablename, 2つ目の#: columnname | |
result = [i[0] for i in conn.fetchall()] # <type 'list'> | |
print result |
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 -*- | |
from requests_oauthlib import OAuth1Session | |
def tweet(status, batch_mode, in_reply_to_status_id=None): | |
global tweet_id | |
if batch_mode: | |
params = {"status": status, "batch_mode": "first", "weighted_character_count": True} | |
else: | |
params = {"status": status, "in_reply_to_status_id": in_reply_to_status_id, "batch_mode": "subsequent", "weighted_character_count": True} |
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 -*- | |
import tweepy | |
import requests | |
import xmltodict | |
import HTMLParser | |
import random | |
import re | |
def normalText(tweet): |
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 -*- | |
import requests | |
from bs4 import BeautifulSoup | |
import re | |
def createurl(url, ep=""): | |
url += ep; url = url.replace("m//", "m/") if "//" in url else url; return url | |
songtitle = raw_input(">>>") |
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 -*- | |
# !python3 | |
from PIL import Image | |
import appex | |
import ui | |
from objc_util import NSBundle, ObjCClass, uiimage_to_png, CGSize | |
import tweepy | |
import io | |
import os |
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 -*- | |
from PIL import Image, ImageOps | |
import numpy as np | |
import os | |
file = "" # ここに読み込む画像ファイル名を入力 | |
img = Image.open(file) | |
filename = file.split("/")[-1].split(".")[0] | |
if not os.exist("changedImage"): | |
os.mkdir("changedImage") |
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 -*- | |
import itertools | |
base = range(10) | |
data = list(itertools.permutations(base, 6)) | |
data = list(map(lambda x: None if x[5] % 2 != 0 or x[0] == 0 else x, data)) | |
data = list(filter(None, data)) | |
for き, く, さ, す, ま, ゆ in data: | |
まゆすき = int(f'{ま}{ゆ}{す}{き}') | |
さくままゆ = int(f'{さ}{く}{ま}{ま}{ゆ}') | |
if まゆすき < 1000 or さくままゆ < 10000: |
OlderNewer