Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PHPerが聞きたいPythonのいくつかのこと - PyCon mini Sapporo 2...

PHPerが聞きたいPythonのいくつかのこと - PyCon mini Sapporo 2019 #pyconsap

PyCon mini Sapporo 2019 #pyconsap
LTでの発表。

Kihara, Takuya

May 11, 2019
Tweet

More Decks by Kihara, Takuya

Other Decks in Technology

Transcript

  1. 1Z$PONJOJ4BQQPSP @tacck 1)1FS͕ฉ͖͍ͨ 1ZUIPOͷ͍͔ͭ͘ͷ͜ͱ 2019/05/11 1)1FS 1ZUIPO 1ZUIPO 1ZUIPO 1ZUIPO

    1ZUIPO 1ZUIPO 1ZUIPO 1ZUIPO 1ZUIPO 1)1FS 1)1FS 1)1FS 1)1FS 1)1FS 1)1FS 1)1FS 1)1FS
  2. 1Z$PONJOJ4BQQPSPQZDPOTBQ !UBDDL ୭ • ໊લ tacck / ໦ݪ ୎໵ •

    ॴଐ גࣜձࣾϊʔεσΟςʔϧ • ࢓ࣄ ϞϏϦςΟIoTࣄۀ ͷԿͰ΋԰
  3. 1Z$PONJOJ4BQQPSPQZDPOTBQ !UBDDL Foo.php SubFolder Bar.php Folder (ύοέʔδ໊: App) <?php namespace

    App; use App\SubFolder\Bar; class Foo { public function someFunc() { $bar = new Bar(); } }
  4. 1Z$PONJOJ4BQQPSPQZDPOTBQ !UBDDL Foo.php SubFolder Bar.php Folder (ύοέʔδ໊: App) <?php namespace

    App; use App\SubFolder\Bar; class Foo { public function someFunc() { $bar = new Bar(); } } “ύοέʔδ໊” + “SubFolder” + “Ϋϥε໊” Ͱɺ “Bar.php” ಺ͷΫϥεΛࢀরɻ
  5. 1Z$PONJOJ4BQQPSPQZDPOTBQ !UBDDL Foo.php SubFolder Bar.php Folder (ύοέʔδ໊: App) <?php namespace

    App; use App\SubFolder\Bar; class Foo { public function someFunc() { $bar = new Bar(); } } “ύοέʔδ໊” + “SubFolder” + “Ϋϥε໊” Ͱɺ “Bar.php” ಺ͷΫϥεΛࢀরɻ ͜ͷΫϥε಺Ͱ͸ Ϋϥε໊͚ͩͰݺͼग़͠Մೳ
  6. 1Z$PONJOJ4BQQPSPQZDPOTBQ !UBDDL Foo.py SubFolder (ύοέʔδ໊) Bar.py (Ϟδϡʔϧ໊) Folder class Bar:

    … class Hoge: … ϑΝΠϧ໊͸Ϟδϡʔϧ໊ ϑΝΠϧ಺ʹෳ਺ΫϥεهࡌՄೳ PHPͩͱ “ϑΥϧμ໊” ͕ “Ϟδϡʔϧ໊” తͳҐஔ෇͚
  7. 1Z$PONJOJ4BQQPSPQZDPOTBQ !UBDDL Foo.py SubFolder (ύοέʔδ໊) Bar.py (Ϟδϡʔϧ໊) Folder import SubFolder.Bar

    class Foo: def someFunc(self): bar = SubFolder.Bar.Bar() “ύοέʔδ໊” + “Ϟδϡʔϧ໊” + “Ϋϥε໊” “Bar.py” ಺ͷΫϥεΛࢀর ࢖͍͍ͨ “ύοέʔδ໊” + “Ϟδϡʔϧ໊” هࡌ ͜ͷϞδϡʔϧ಺Ͱ “SubFolder.Bar” Λ࢖༻
  8. 1Z$PONJOJ4BQQPSPQZDPOTBQ !UBDDL Foo.py SubFolder (ύοέʔδ໊) Bar.py (Ϟδϡʔϧ໊) Folder from SubFolder.Bar

    import Bar class Foo: def someFunc(self): bar = Bar() fromʹ “ύοέʔδ໊” + “Ϟδϡʔϧ໊” هࡌ ͜ͷதͷ “Ϋϥε” Λ࢖༻͢Δએݴ importͷޙʹॻ͍ͨ “Bar” ΛϞδϡʔϧ಺Ͱ࢖༻
  9. 1Z$PONJOJ4BQQPSPQZDPOTBQ !UBDDL Foo.py SubFolder (ύοέʔδ໊) Bar.py (Ϟδϡʔϧ໊) Folder from SubFolder.Bar

    import Bar class Foo: def someFunc(self): bar = Bar() ͜ͷॻ͖ํΛ͢Δͱɺ
 PHPͱಉ͡Α͏ͳײ͡ͰΫϥεΛࢀরͰ͖Δɻ fromʹ “ύοέʔδ໊” + “Ϟδϡʔϧ໊” هࡌ ͜ͷதͷ “Ϋϥε” Λ࢖༻͢Δએݴ importͷޙʹॻ͍ͨ “Bar” ΛϞδϡʔϧ಺Ͱ࢖༻
  10. 1Z$PONJOJ4BQQPSPQZDPOTBQ !UBDDL Foo.py SubFolder (ύοέʔδ໊) Bar.py (Ϟδϡʔϧ໊) Folder from SubFolder.Bar

    import Bar class Foo: def someFunc(self): bar = Bar() fromʹ “ύοέʔδ໊” + “Ϟδϡʔϧ໊” هࡌ ͜ͷதͷ “Ϋϥε” Λ࢖༻͢Δએݴ importͷޙʹॻ͍ͨ “Bar” ΛϞδϡʔϧ಺Ͱ࢖༻ ͜ͷॻ͖ํΛ͢Δͱɺ
 PHPͱಉ͡Α͏ͳײ͡ͰΫϥεΛࢀরͰ͖Δɻ ͜ΕͰ
 ྑ͍ΜͰ͔͢Ͷ?