SlideShare une entreprise Scribd logo
1  sur  30
Python 入門から Python-Twitter 利用のハンズオン ,[object Object],[object Object]
お前、誰よ? Name : Yukitaka Uchikoshi job :  結婚式場で社内 SE id: uchikoshi22 level : Python 初心者クラス
今日の目標 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
1. Hello World
$ python >>> “Hello World” ??? >>> print “Hello World” ??? >>> exit()
2.  名前で呼んでみよう
>>> event = “Python 勉強会” >>> print event ??? >>> place = “@AipCafe” >>> title = event + place >>> print title ???
>>> name = “uchikoshi” >>> number = 22 >>> id = name + number See what's gonna happen. And Fix it >>> print id ???
3.  群れをなそう
>>> lang = [“Python”, “Ruby”,] >>> print lang[1] ??? >>> lang.append(“Perl”) >>> print lang[2] ???
>>> lang[2] = “Java” >>> print lang[2] ??? >>> lang.append(“ なでしこ” ) >>> lang.append(20120129) Think if the last 2 lines are correct
>>> fw = {“django”: “python”,  “ rails”: “ruby”, “ catalyst”: “cisco”} >>> print fw[“python”] ??? >>> fw[“catalyst”] = “perl” >>> fw[“play”] = “java” >>> print fw ???
4.  反復動作で楽をしよう
>>> print 0 >>> print 1 >>> print 2 >>> print 3 >>> print 4 >>> print 5 >>> print 6 >>> print 7 >>> print 8 >>> print 9 >>> print 10
>>> for i in [0, 1, 2, 3, 4, 5]: .  .  .  print i .  .  . ??? >>> for la in lang: .  .  .  prnt la .  .  . ???
5.  人生とは選択の連続である
>>> for i in range(1, 100): .  .  .  if i % 2 == 0: .  .  .  print i .  .  .  else: .  .  .  continue .  .  . ???
>>> lang = [“python”, “ruby”, “perl”] >>> for la in lang: .  .  .  if la == “python”: .  .  .  print “use django” .  .  .  elif la == “ruby”: .  .  .  print “use rails” .  .  .  else: .  .  .  print “Learn Ruby” .  .  .
6.  魔法のランプを作ろう
>>> def gae_fw(): .  .  .  return “kay” .  .  . >>> fw = gae_fw() ??? >>> def web_fw(): .  .  .  return “django”, “flask” .  .  . >>> fw0, fw1 = web_fw() >>> print fw0, “,”, fw1 ???
ナベアツ関数
>>> def nabeatsu(n): .  .  .  if n % 3 == 0: .  .  .  return True .  .  .  elif “3” in str(i): .  .  .  return True  .  .  .  else: .  .  .  return  str(n) .  .  . >>> for i in range(1, 100): .  .  .  if nabeatsu(i): .  .  .  print i, “!!!” .  .  .  else: .  .  .  print I .  .  .  ???
7.  Twitter のタイムラインを 取得しよう
python-twitter の導入 ,[object Object],[object Object],[object Object],[object Object]
twitter.py をダウンロード 口頭で説明します! http://code.google.com/p/python-twitter/ のソースを改変したものです。 (通常は pip でのインストールを推奨します)
次のコードを twitter.py と同じディレクトリに保存してください。 #!/usr/bin/env python import twitter api = twitter.Api() statuses = api.GetUserTimeline(id='uchikoshi22', count=2) for s in statuses: print s.text
[object Object],参考書籍
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],参考 URL
The Zen of Python $python >>>  import this
FukPUG ではハンズオン講師を 募集しています これからもよろしくお願いします

Contenu connexe

Tendances

PyCon2020 Pythonで競プロをしよう! 〜入門者が知っておくべき高速化Tips〜
PyCon2020 Pythonで競プロをしよう! 〜入門者が知っておくべき高速化Tips〜PyCon2020 Pythonで競プロをしよう! 〜入門者が知っておくべき高速化Tips〜
PyCon2020 Pythonで競プロをしよう! 〜入門者が知っておくべき高速化Tips〜
Kosaku Ono
 
Python Kyoto study
Python Kyoto studyPython Kyoto study
Python Kyoto study
Naoya Inada
 
Pythonを取り巻く開発環境 #pyconjp
Pythonを取り巻く開発環境 #pyconjpPythonを取り巻く開発環境 #pyconjp
Pythonを取り巻く開発環境 #pyconjp
Yoshifumi Yamaguchi
 
Python Kyoto study LT
Python Kyoto study LTPython Kyoto study LT
Python Kyoto study LT
Naoya Inada
 
Python3 プログラミング勉強会
Python3 プログラミング勉強会Python3 プログラミング勉強会
Python3 プログラミング勉強会
Tetsuya Morimoto
 

Tendances (20)

第1回python勉強会
第1回python勉強会第1回python勉強会
第1回python勉強会
 
PyCon2020 Pythonで競プロをしよう! 〜入門者が知っておくべき高速化Tips〜
PyCon2020 Pythonで競プロをしよう! 〜入門者が知っておくべき高速化Tips〜PyCon2020 Pythonで競プロをしよう! 〜入門者が知っておくべき高速化Tips〜
PyCon2020 Pythonで競プロをしよう! 〜入門者が知っておくべき高速化Tips〜
 
Python入門
Python入門Python入門
Python入門
 
XML-RPC : Pythonが「電池付属」と呼ばれる理由
XML-RPC : Pythonが「電池付属」と呼ばれる理由XML-RPC : Pythonが「電池付属」と呼ばれる理由
XML-RPC : Pythonが「電池付属」と呼ばれる理由
 
Apilecture for 2014/02/22 at shannonlab
Apilecture for 2014/02/22 at shannonlabApilecture for 2014/02/22 at shannonlab
Apilecture for 2014/02/22 at shannonlab
 
Python Kyoto study
Python Kyoto studyPython Kyoto study
Python Kyoto study
 
20170131 python3 6 PEP526
20170131 python3 6 PEP526 20170131 python3 6 PEP526
20170131 python3 6 PEP526
 
Python パッケージの影響を歴史から理解してみよう!
Python パッケージの影響を歴史から理解してみよう!Python パッケージの影響を歴史から理解してみよう!
Python パッケージの影響を歴史から理解してみよう!
 
Pythonを取り巻く開発環境 #pyconjp
Pythonを取り巻く開発環境 #pyconjpPythonを取り巻く開発環境 #pyconjp
Pythonを取り巻く開発環境 #pyconjp
 
Python Kyoto study LT
Python Kyoto study LTPython Kyoto study LT
Python Kyoto study LT
 
Pythonでゲーム作る
Pythonでゲーム作るPythonでゲーム作る
Pythonでゲーム作る
 
PyCon JP 2012 hands-on セッション/ FlaskによるWebアプリケーションの実装とプログラミングツール
PyCon JP 2012 hands-on セッション/ FlaskによるWebアプリケーションの実装とプログラミングツールPyCon JP 2012 hands-on セッション/ FlaskによるWebアプリケーションの実装とプログラミングツール
PyCon JP 2012 hands-on セッション/ FlaskによるWebアプリケーションの実装とプログラミングツール
 
PEP8を読んでみよう
PEP8を読んでみようPEP8を読んでみよう
PEP8を読んでみよう
 
Python3 プログラミング勉強会
Python3 プログラミング勉強会Python3 プログラミング勉強会
Python3 プログラミング勉強会
 
Python 2/3コード共存戦略 #osakapy
Python 2/3コード共存戦略 #osakapyPython 2/3コード共存戦略 #osakapy
Python 2/3コード共存戦略 #osakapy
 
素振りのススメ at Python入門者の集い
素振りのススメ at Python入門者の集い素振りのススメ at Python入門者の集い
素振りのススメ at Python入門者の集い
 
Elog and Ebuild Phase Hook
Elog and Ebuild Phase HookElog and Ebuild Phase Hook
Elog and Ebuild Phase Hook
 
各OSにおいて、OpenCVをpythonから使う方法
各OSにおいて、OpenCVをpythonから使う方法各OSにおいて、OpenCVをpythonから使う方法
各OSにおいて、OpenCVをpythonから使う方法
 
オープンCAEとPython
オープンCAEとPythonオープンCAEとPython
オープンCAEとPython
 
Introduction of Python
Introduction of PythonIntroduction of Python
Introduction of Python
 

Similaire à Python入門からpython twitter利用のハンズオン

2008.10.18 L4u Tech Talk
2008.10.18 L4u Tech Talk2008.10.18 L4u Tech Talk
2008.10.18 L4u Tech Talk
mitamex4u
 
Can A Python Go Beyond The Python
Can A Python Go Beyond The PythonCan A Python Go Beyond The Python
Can A Python Go Beyond The Python
Yusuke Muraoka
 
ハードウェアによる仮想化支援機能を利用したハイパバイザーIPS
ハードウェアによる仮想化支援機能を利用したハイパバイザーIPSハードウェアによる仮想化支援機能を利用したハイパバイザーIPS
ハードウェアによる仮想化支援機能を利用したハイパバイザーIPS
FFRI, Inc.
 
はじめてのPython
はじめてのPythonはじめてのPython
はじめてのPython
Katsumi Honda
 
Collective_Intelligence_chap2
Collective_Intelligence_chap2Collective_Intelligence_chap2
Collective_Intelligence_chap2
Yutaro Sugai
 

Similaire à Python入門からpython twitter利用のハンズオン (20)

2008.10.18 L4u Tech Talk
2008.10.18 L4u Tech Talk2008.10.18 L4u Tech Talk
2008.10.18 L4u Tech Talk
 
rpi_handson_2.5
rpi_handson_2.5rpi_handson_2.5
rpi_handson_2.5
 
SwiftのOptionalを理解する
SwiftのOptionalを理解するSwiftのOptionalを理解する
SwiftのOptionalを理解する
 
Security.gs fes 2010 in tokyo
Security.gs fes 2010 in tokyoSecurity.gs fes 2010 in tokyo
Security.gs fes 2010 in tokyo
 
221217 SwiftはPythonに似ている
221217 SwiftはPythonに似ている221217 SwiftはPythonに似ている
221217 SwiftはPythonに似ている
 
Can A Python Go Beyond The Python
Can A Python Go Beyond The PythonCan A Python Go Beyond The Python
Can A Python Go Beyond The Python
 
Twitter sphere of #twitter4j #twtr_hack
Twitter sphere of #twitter4j #twtr_hackTwitter sphere of #twitter4j #twtr_hack
Twitter sphere of #twitter4j #twtr_hack
 
日常業務にperlを使おう
 日常業務にperlを使おう 日常業務にperlを使おう
日常業務にperlを使おう
 
ハードウェアによる仮想化支援機能を利用したハイパバイザーIPS
ハードウェアによる仮想化支援機能を利用したハイパバイザーIPSハードウェアによる仮想化支援機能を利用したハイパバイザーIPS
ハードウェアによる仮想化支援機能を利用したハイパバイザーIPS
 
20220615_Visual_Programing_IoTLT_vol11_kitazaki_v1.pdf
20220615_Visual_Programing_IoTLT_vol11_kitazaki_v1.pdf20220615_Visual_Programing_IoTLT_vol11_kitazaki_v1.pdf
20220615_Visual_Programing_IoTLT_vol11_kitazaki_v1.pdf
 
はじめてのPython
はじめてのPythonはじめてのPython
はじめてのPython
 
Collective_Intelligence_chap2
Collective_Intelligence_chap2Collective_Intelligence_chap2
Collective_Intelligence_chap2
 
Django_fukuoka
Django_fukuokaDjango_fukuoka
Django_fukuoka
 
StreamingAPIを使用したTwitter Bot @waketi の紹介
StreamingAPIを使用したTwitter Bot @waketi の紹介 StreamingAPIを使用したTwitter Bot @waketi の紹介
StreamingAPIを使用したTwitter Bot @waketi の紹介
 
Django_Fukuoka
Django_FukuokaDjango_Fukuoka
Django_Fukuoka
 
Programming camp Codereading
Programming camp CodereadingProgramming camp Codereading
Programming camp Codereading
 
CLR/H No.35-2
CLR/H No.35-2CLR/H No.35-2
CLR/H No.35-2
 
Making a Drone by Python using RaspberryPi and Google VoiceKit
Making a Drone by Python using RaspberryPi and Google VoiceKitMaking a Drone by Python using RaspberryPi and Google VoiceKit
Making a Drone by Python using RaspberryPi and Google VoiceKit
 
Go Friday 傑作選
Go Friday 傑作選Go Friday 傑作選
Go Friday 傑作選
 
マルチコアを用いた画像処理
マルチコアを用いた画像処理マルチコアを用いた画像処理
マルチコアを用いた画像処理
 

Python入門からpython twitter利用のハンズオン