tacchini's manual

自分用のマニュアルを作成します。

朝会の発表

おはようございます。本日は発話機能で発表します。

自分が喋る代わりに、書いてある文章を読み上げています。

読み上げ機能はpocketというあとで読むサービスのiphoneアプリの機能です。

なぜ読み上げ機能がついているのか考えました。

オーディオブックを聞くのと同じ感覚で、あとで読むサービスに追加した記事を聞きたい人がいるのかもしれません。

オーディオブックは本を朗読した音声を記録したものです。

オーディオブックは日本では車通勤の人が少ないので普及していません。

python string

写経します

文字列 - Python入門から応用までの学習サイト

# -*- coding: utf-8 -*-
print 'tacchini-blog'
print "tacchini-blog"
print """tacchini-blog1
tacchini-blog2
tacchini-blog3"""
print """
tacchini-blog-a
tacchini-blog-b
tacchini-blog-c
"""
print 'tacchini' + '-' + 'blog'
test_str = 'tacchini'
test_str += '-'
test_str += 'blog'
print test_str
print 'tacchini-' * 3
print str(100) + '円'
print 'tacchini-blog'.replace('-', '#')
print 'tacchini-blog'.split('-')
print '108'.rjust(10, '0')
print '108'.rjust(10, ' ')
print '108'.ljust(10, '0')
print '108'.ljust(10, '+')
print '108'.zfill(10)
print '108'.zfill(3)
print '108'.zfill(-10)
print 'tacchini-blog'.startswith('tacchini-blog')
print 'tacchini-blog'.startswith('blog')
print 'c' in 'tacchini-blog'
print 'd' in 'tacchini-blog'
print 'Tacchini-Blog'.upper()
print 'Tacchini-Blog'.lower()
print '-' * 30
print '          tacchini-blog'
print '          tacchini-blog'.lstrip()
print 'tacchini-blog'.lstrip('tacchini')
print '-' * 30
print 'tacchini-blog.com          /'
print 'tacchini-blog.com          '.rstrip() + '/'
print 'tacchini-blog.com'.rstrip('com')

beautifulsoup

<title> タグを取得

# -*- coding:utf-8 -*-

import urllib2
from bs4 import BeautifulSoup

html = urllib2.urlopen("http://kazuyan.hatenablog.com/entry/building-a-large-scale-design-system")
soup = BeautifulSoup(html)
print soup.title.string

実行結果

 大規模デザインシステムを作る:いかにしてアメリカ連邦政府のデザインシステムを作り上げたか - カタパルト式!スープレックス!!

参考

qiita.com