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

有沒有 Python 可以寫 Native Mobile Apps 的八卦?

有沒有 Python 可以寫 Native Mobile Apps 的八卦?

Native GUI programming with Python everywhere with Toga!

Tzu-ping Chung

October 26, 2014
Tweet

More Decks by Tzu-ping Chung

Other Decks in Programming

Transcript

  1. 剤尝剤1ZUIPO〳⟃㻨/BUJWF
    .PCJMF"QQT涸Ⱄ⽚

    View full-size slide

  2. Live Demo!!!!1

    View full-size slide

  3. Me
    • Call me TP
    • Follow @uranusjr
    • https://uranusjr.com

    View full-size slide

  4. http://macdown.uranusjr.com

    View full-size slide

  5. IUUQQZCFFPSHUPHB

    View full-size slide

  6. Python code
    Platform-dependent implementation
    Native libraries

    View full-size slide

  7. Toga
    • No dependencies
    • Except a custom interpreter
    • Pure Python
    • ctypes
    • Any OS you want
    • Write your own backend

    View full-size slide

  8. Your code
    Native libraries
    Toga implementation
    Toga

    View full-size slide

  9. Your code
    Foundation + UIKit + …
    Toga-iOS + Rubicon-ObjC
    Toga

    View full-size slide

  10. Live Coding!!!!1

    View full-size slide

  11. Cassowary
    • Constraint-solving
    • Foundation of Auto Layout
    • Other implementations available

    View full-size slide

  12. 50
    50 50
    50 or more

    View full-size slide

  13. container.constrain(  
           button.TOP  ==  container.TOP  +  50,  
           button.LEADING  ==  container.LEADING  +  50,  
           button.TRAILING  +  50  ==  container.TRAILING,  
           button.BOTTOM  +  50  <=  container.BOTTOM,  
    )

    View full-size slide

  14. Join the Conversation
    • https://github.com/pybee
    • https://groups.google.com/forum/#!forum/beeware-users
    • https://groups.google.com/forum/#!forum/beeware-developers
    • https://groups.google.com/forum/#!forum/overconstrained
    • https://twitter.com/pybeeware

    View full-size slide