Slide 1

Slide 1 text

ٕज़ॻࠪಡɾߍਖ਼ͷݱ৔͔Β Hayao Suzuki BPStudy #123 Lightning Talk November 24, 2017

Slide 2

Slide 2 text

Who Am I? About Me Name Hayao Suzuki (@CardinalXaro) Blog http://xaro.hatenablog.jp/ Major Mathematics (Combinatorics, Number Theory) Work Python Programmer at iRidge, Inc. Reviewed Books Effective Python (O’Reilly Japan) ΞϧΰϦζϜΫΠοΫϦϑΝϨϯε ୈ 2 ൛ (O’Reilly Japan) ॳΊͯͷ PHP (O’Reilly Japan) Effective Debugging (O’Reilly Japan) ͢Β͢ΒΘ͔Δ Python ʢᠳӭࣾʣ Python ͱ JavaScript Ͱ͸͡ΊΔσʔλϏδϡΞϥΠθʔγϣϯ (O’Reilly Japan) 2 / 15

Slide 3

Slide 3 text

Today’s Theme ٕज़ॻࠪಡɾߍਖ਼ͷݱ৔͔Β 3 / 15

Slide 4

Slide 4 text

Question ݻ༗໊ࢺ͸ਖ਼֬ʹ Reqeusts ͸΢ΣϒαΠτʹΞΫηεͯ͠ HTML ͳͲͷσʔλΛऔಘ͢ ΔͨΊͷϥΠϒϥϦͰ͢ɻ ໰ɿޡΓΛࢦఠͤΑʢ10 ఺ʣ 4 / 15

Slide 5

Slide 5 text

Answer ݻ༗໊ࢺ͸ਖ਼֬ʹ Requests ͸΢ΣϒαΠτʹΞΫηεͯ͠ HTML ͳͲͷσʔλΛऔಘ͢ ΔͨΊͷϥΠϒϥϦͰ͢ɻ ಉ͡υΩϡϝϯτʹ Requests ͷ௲Γؒҧ͍͕ 3 Օॴ͋Γ·ͨ͠ɻ 5 / 15

Slide 6

Slide 6 text

Question ݻ༗໊ࢺ͸ਖ਼֬ʹ Anacondaʢ޿͘࢖ΘΕ͍ͯΔ෼ੳϥΠϒϥϦͷ΄ͱΜͲΛศརͳύο έʔδʹ·ͱΊͨ Phtyon ϓϥοτϑΥʔϜʣͷ͓͔͛ͰɺҎલ͸໘౗ ͩͬͨ OS ͝ͱʹҟͳΔΠϯετʔϧํ๏΍ݻ༗ͷบΛઆ໌͢Δ͜ͱ͕ͱ ͯ΋༰қʹͳΓ·ͨ͠ɻ ໰ɿޡΓΛࢦఠͤΑʢ10 ఺ʣ 6 / 15

Slide 7

Slide 7 text

Answer ݻ༗໊ࢺ͸ਖ਼֬ʹ Anacondaʢ޿͘࢖ΘΕ͍ͯΔ෼ੳϥΠϒϥϦͷ΄ͱΜͲΛศརͳύο έʔδʹ·ͱΊͨ Python ϓϥοτϑΥʔϜʣͷ͓͔͛ͰɺҎલ͸໘౗ ͩͬͨ OS ͝ͱʹҟͳΔΠϯετʔϧํ๏΍ݻ༗ͷบΛઆ໌͢Δ͜ͱ͕ͱ ͯ΋༰қʹͳΓ·ͨ͠ɻ ௲Γ͸ਖ਼֬ʹɻ 7 / 15

Slide 8

Slide 8 text

Question จ๏͸ਖ਼֬ʹ 2 ͭͷݴޠͷओͳྨࣅ఺ͱ૬ҧ఺Λࣔͨ͠ޙʹɺPython ͱ JavaScript ͷֶश؀ڥΛ༻ҙ͍͠·͢ɻ ໰ɿޡΓΛࢦఠͤΑʢ10 ఺ʣ 8 / 15

Slide 9

Slide 9 text

Answer จ๏͸ਖ਼֬ʹ 2 ͭͷݴޠͷओͳྨࣅ఺ͱ૬ҧ఺Λࣔͨ͠ޙʹɺPython ͱ JavaScript ͷֶश؀ڥΛ༻ҙ͠·͢ ɻ ڧ͍ͯ͸͍͚ͳ͍ɻ 9 / 15

Slide 10

Slide 10 text

Question Python 3 ܥରԠʁ $ python -m SimpleHTTPServer ໰ɿPython 3 ʹରԠͤ͞Αʢ10 ఺ʣ 10 / 15

Slide 11

Slide 11 text

Answer Python 3 ܥରԠʁ $ python -m http.server Python 3 Ͱ͸ http.server ΁໊শ͕มߋ͞Εͨɻ 11 / 15

Slide 12

Slide 12 text

Question Python ͷݴޠ࢓༷ Python ʹ͸ 3 ͭͷ਺஋ܕ͕͋Γ·͢ɻֶੜͷ੒੷ΛΩϟετͨ͠ 32bit ͷ intɺJavaScript ͷ number ʹ૬౰͢Δ floatʢIEEE 754ʣ ɺ೚ҙ ਫ਼౓੔਺ԋࢉ༻ͷ long Ͱ͢ɻ ໰ɿPython 3 ରԠΛᨳ͍ͬͯΔͱ͍͏લఏͰɺ͜ͷจΛमਖ਼ͤΑɻ ʢ10 ఺ʣ 12 / 15

Slide 13

Slide 13 text

Answer Python ͷݴޠ࢓༷ Python ʹ͸ 3 ͭͷجຊతͳ਺஋ܕ͕͋Γ·͢ɻֶੜͷ੒੷ΛΩϟετ͠ ͨ೚ҙਫ਼౓੔਺ͷ intɺJavaScript ͷ number ʹ૬౰͢Δ float ʢIEEE 754ʣ ɺෳૉ਺ͷ complex Ͱ͢ɻ͞Βʹɺेਐුಈখ਺఺ࢉज़ͷͨ Ίͷ Decimal ܕɺ༗ཧ਺ͷ Fraction ܕ͕͋Γ·͢ɻ Python 3 Ͱ͸ Python 2 ͷ int ͱ long ͕౷߹͞Εͨɻجຊతͳ਺஋ ܕͷதʹෳૉ਺ܕ͕ଘࡏ͢Δ͜ͱΛ๨Εͯ͸͍͚ͳ͍ɻ 13 / 15

Slide 14

Slide 14 text

Question ΋ͬͱ΋Β͍͠هड़Ͱ͋Δ͕ HTML ͸ɺ1980 ೥ʹ෺ཧֶऀͷ Tim Berners-Lee ͕࠷ॳʹఏҊ͠ ·ͨ͠ɻ൴͸౰࣌ɺεΠεʹ͋ΔཻࢠՃ଎ثࢪઃɺCERN Ͱಇ͍͍ͯ· ͨ͠ɻ ໰ɿ͜ͷจͷؒҧ͍ΛࢦఠͤΑʢ10 ఺ʣ 14 / 15

Slide 15

Slide 15 text

Answer ΋ͬͱ΋Β͍͠هड़Ͱ͋Δ͕ HTML ͸ɺ1980 ೥ʹܭࢉػՊֶऀͷ Tim Berners-Lee ͕࠷ॳʹఏ Ҋ͠·ͨ͠ɻ൴͸౰࣌ɺεΠεʹ͋ΔཻࢠՃ଎ثࢪઃɺCERN Ͱಇ͍͍ͯ ·ͨ͠ɻ Tim Berners-Lee ͸ CERN ʹ͸ Consultant Software Engineer ͱͯ͠ಇ͍͍ͯΔɻҰํɺେֶͰ͸෺ཧֶΛֶΜͰ͍Δɻ 15 / 15