SlideShare a Scribd company logo
Pythonって入ってるの?

 $ python
 Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
 [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
 Type "help", "copyright", "credits" or "license" for more information.
 >>> exit
 Use exit() or Ctrl-D (i.e. EOF) to exit
 >>> exit()



入ってた。Xcodeで入ったのかな?

Google App Engineやってみる

 https://developers.google.com/appengine/docs/python/gettingstarted/introduction?hl=ja




App Engine SDK が必要らしい

 https://developers.google.com/appengine/downloads




ダウンロードしてインストールした

どうやらMacのApp。動かしてみるか。




こんなんでてきた




いくぜHelloWorld

 1. helloworld ディレクトリを作る

 2. helloworld.py ファイルを作る

 3. app.yaml ファイルを作る。設定ファイルっぽいね。YAMLってなんだっけ?


もう動かせるらしい




Google App Engine Lancherを起動




テスト

 http://localhost:8080




おぉ。動いた

ちょっと変更

 print 'ビール飲みたい'



おぉ。エラー
まぁいいや。日本語が問題なんだね。そのうち分かるでしょう。




英語にしてみる

 print 'I wanna drink a beer!!'



うごいたうごいた




webappフレームワークを使ってみる

 from google.appengine.ext import webapp
 from google.appengine.ext.webapp.util import run_wsgi_app

 class MainPage(webapp.RequestHandler):
     def get(self):
         self.response.headers['Content-Type'] = 'text/plain'
         self.response.out.write('Hello, webapp World!')

 application = webapp.WSGIApplication(
                                         [('/', MainPage)],
                                         debug=True)

 def main():
     run_wsgi_app(application)

 if __name__ == "__main__":
     main()



できたできた

 http://localhost:8080




この先ちょっと面倒っぽいからGAEはここまで

ちょっとプログラマっぽく

メソッドってどう書くの?
def らしい



さっそくやってみる

 def hello()
     print 'Content-Type: text/plain'
     print ''
     print 'HelloWorld'

 hello()



エラー(´・ω・`)

あれ?違うの?

メソッドの終わりにセミコロンが必要でした

 def hello():
     print 'Content-Type: text/plain'
     print ''
     print 'HelloWorld'

 hello()



いいエディタはいいですね

とりあえずここで時間切れ

ちなみにTitanium MobileのPythonスクリプト

More Related Content

PPTX
20110910 闇鍋的php魔改造
PDF
Windows で拡張モジュールをビルドしてみた
PDF
PPTX
PSR-1 と PSR-2 を 5分でざっくり理解する
PDF
役に立ちそうだけど、やっぱり役に立たなそうな技術Quine
PDF
実"戦"CakePHP Plugin
PDF
15分でCakePHPを始める方法(Nseg 2013-11-09 )
PDF
PHP の GC の話
20110910 闇鍋的php魔改造
Windows で拡張モジュールをビルドしてみた
PSR-1 と PSR-2 を 5分でざっくり理解する
役に立ちそうだけど、やっぱり役に立たなそうな技術Quine
実"戦"CakePHP Plugin
15分でCakePHPを始める方法(Nseg 2013-11-09 )
PHP の GC の話

Viewers also liked (8)

PDF
Ti勉強会名古屋 配布用
PDF
Titanium Nagoya Chatroom vol.2 はじめの一歩
PDF
大なごやJS vol.6 Titanium Mobile と Alloy の解説をするよ!
KEY
2012年1月30日 現代戦闘機入門 at GeekBar
KEY
2011 12-10 Titanium Developer Meeting 大阪 LT
KEY
2011年12月10日 Ti.Developers.Meeting大阪 LT資料
PDF
Tiなごや vol.3 Titaniumのキホン
PDF
WCAN Autumn 2013 Titaniumのおはなし
Ti勉強会名古屋 配布用
Titanium Nagoya Chatroom vol.2 はじめの一歩
大なごやJS vol.6 Titanium Mobile と Alloy の解説をするよ!
2012年1月30日 現代戦闘機入門 at GeekBar
2011 12-10 Titanium Developer Meeting 大阪 LT
2011年12月10日 Ti.Developers.Meeting大阪 LT資料
Tiなごや vol.3 Titaniumのキホン
WCAN Autumn 2013 Titaniumのおはなし
Ad

Similar to Python東海GAEやってみた (20)

KEY
Hello World Python featuring GAE
PDF
Flask勉強会その1
ODP
Introduction of Python
PDF
はじめてのPython - 開発環境の準備 for Mac
PDF
PDF
はじめてのPython - 開発環境の準備 for Windows
PDF
appengine ja night #25 Google App Engine for PHP
PPTX
PDF
はじめてのPython
PPTX
Python勉強会資料(MessageBoard作成)
PDF
Pythonおじさんのweb2py挑戦記
PPT
単機能Twitter クライアント試作のための各種方法の検討
PDF
Djangoのススメ
PPTX
App Engine と いまどきのPHP
PDF
Niigata.pm #1
PDF
Djangoとweb2pyをapacheに組込む
PPTX
【プログラミング教室】テキスト
PDF
Introduction Pycon2010
PDF
Yapc2012ltthon
PDF
入門書を読み終わったらなにしよう? 〜Python と WebAPI の使い方から学ぶ次の一歩〜 / next-step-python-programing
Hello World Python featuring GAE
Flask勉強会その1
Introduction of Python
はじめてのPython - 開発環境の準備 for Mac
はじめてのPython - 開発環境の準備 for Windows
appengine ja night #25 Google App Engine for PHP
はじめてのPython
Python勉強会資料(MessageBoard作成)
Pythonおじさんのweb2py挑戦記
単機能Twitter クライアント試作のための各種方法の検討
Djangoのススメ
App Engine と いまどきのPHP
Niigata.pm #1
Djangoとweb2pyをapacheに組込む
【プログラミング教室】テキスト
Introduction Pycon2010
Yapc2012ltthon
入門書を読み終わったらなにしよう? 〜Python と WebAPI の使い方から学ぶ次の一歩〜 / next-step-python-programing
Ad

More from Mori Shingo (7)

PDF
Tiなごや vol.3 Alloyやろまい
PDF
福井スマートフォンハッカソン Titanium Mobileの紹介
PDF
Node予備校 vol.1 名古屋
PPTX
2011年10月27日 Titanium meetup Tokyo #14 LT資料
PPTX
2011年10月22日 iPhoneDeveloper勉強会 名古屋 #2 LT資料
PDF
Html5とう勉強会lt アニメーション無し.pptx
PPT
2010-10-2 FxUG 名古屋勉強会 HTML5で遊んでみよう
Tiなごや vol.3 Alloyやろまい
福井スマートフォンハッカソン Titanium Mobileの紹介
Node予備校 vol.1 名古屋
2011年10月27日 Titanium meetup Tokyo #14 LT資料
2011年10月22日 iPhoneDeveloper勉強会 名古屋 #2 LT資料
Html5とう勉強会lt アニメーション無し.pptx
2010-10-2 FxUG 名古屋勉強会 HTML5で遊んでみよう

Python東海GAEやってみた

  • 1. Pythonって入ってるの? $ python Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> exit Use exit() or Ctrl-D (i.e. EOF) to exit >>> exit() 入ってた。Xcodeで入ったのかな? Google App Engineやってみる https://developers.google.com/appengine/docs/python/gettingstarted/introduction?hl=ja App Engine SDK が必要らしい https://developers.google.com/appengine/downloads ダウンロードしてインストールした どうやらMacのApp。動かしてみるか。 こんなんでてきた いくぜHelloWorld 1. helloworld ディレクトリを作る 2. helloworld.py ファイルを作る 3. app.yaml ファイルを作る。設定ファイルっぽいね。YAMLってなんだっけ? もう動かせるらしい Google App Engine Lancherを起動 テスト http://localhost:8080 おぉ。動いた ちょっと変更 print 'ビール飲みたい' おぉ。エラー まぁいいや。日本語が問題なんだね。そのうち分かるでしょう。 英語にしてみる print 'I wanna drink a beer!!' うごいたうごいた webappフレームワークを使ってみる from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app class MainPage(webapp.RequestHandler): def get(self): self.response.headers['Content-Type'] = 'text/plain' self.response.out.write('Hello, webapp World!') application = webapp.WSGIApplication( [('/', MainPage)], debug=True) def main(): run_wsgi_app(application) if __name__ == "__main__": main() できたできた http://localhost:8080 この先ちょっと面倒っぽいからGAEはここまで ちょっとプログラマっぽく メソッドってどう書くの? def らしい さっそくやってみる def hello() print 'Content-Type: text/plain' print '' print 'HelloWorld' hello() エラー(´・ω・`) あれ?違うの? メソッドの終わりにセミコロンが必要でした def hello(): print 'Content-Type: text/plain' print '' print 'HelloWorld' hello() いいエディタはいいですね とりあえずここで時間切れ ちなみにTitanium MobileのPythonスクリプト