リスクにかけろ

株と金融とプログラミング

python

pythonでNon-BMP文字を削除する

Seleniumを使っていると、SeleniumがNon-BMPは使えないよってエラーを吐くのでその対策 解決策はこちら Remove characters outside of the BMP (emoji's) in Python 3 - Stack Overflow data = "this variable contains some emoji'sツ" data = ''.join(c fo…

To get rid of this warning, change this: 

teratail.com

pythonとtwitterのAPIを使ってタイムラインを取得

qiita.com このまんまです。 OAuth認証のkeyを取得するだけ。 #!/usr/bin/env python # -*- coding: utf-8 -*- from requests_oauthlib import OAuth1Session import json CK = 'XXXXXXXXXXXXXXXXXXXXXX' # Consumer Key CS = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX…

pythonでRSS取得

お勉強がてら、pythonでRSSを取得してみた。 元のサンプルコードはここからコピペmake.bcde.jp コードは以下のとおり。 #!/usr/bin/env python # -*- coding: utf-8 -*- import feedparser from datetime import datetime from time import mktime #RSSのURL…

素数を求めるアルゴリズム

def sosu(s): for i in range(2,s-1): if s % i ==0: return ("素数じゃない") else: return ("素数") sosu(10)