SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
Pythonista
iOS
@jbking
PyCon JP 2017
Who?
@jbking
Yarch( )
ex-OpenStacker
IoT Platform
Pythonista
?
Pythonista
• Pythonista: A full-featured Python environment for iOS devices
• europython 2014 https://ep2014.europython.eu/en/
schedule/sessions/109/
• Pythonista Pythonista 

iOS Pythonista
• https://pycon.jp/2016/ja/schedule/presentation/47/ PyCon
JP 2016
• Pythonista
• PyCon mini Kumamoto
(1)
•
•
• Pythonista iOS
• iOS Pythonista
•
• NumPy SymPy, SimPy, Matplotlib
• StaSh
• , Git
(2)
•
• iOS Python
•
• Python
• Objective-C
• iOS
Pythonista
iOS
•
• Xcode
•
• AppStore ?
•
• Xcode https://github.com/omz/
PythonistaAppTemplate
• Python
Pythonista iOS
• Pythonista Python
• iOS Framework Python
•
•
Python
Yes
No
Pythonista
No
Yes
C
iOS objc_util
No
Yes
Yes
No
• Pythonista
•
• (BLE)
• iOS
• ( , C/S)
• GPIO
•
• Python
• NG
• iOS Pythonista
• objc_util
• ( Framework … )
•
•
objc_util ???
objc_util
• Pythonista
• Objective-C
•
• iOS
• objc_msgSend
Framework
from objc_util import *
NSBundle.bundleWithPath_('/System/Library/
Frameworks/Photos.framework').load()
AVFoundation.framework AVKit.framework Accelerate.framework Accounts.framework AdSupport.framework
AddressBook.framework AddressBookUI.framework AssetsLibrary.framework AudioToolbox.framework
AudioUnit.framework CFNetwork.framework CallKit.framework CloudKit.framework Contacts.framework
ContactsUI.framework CoreAudio.framework CoreAudioKit.framework CoreBluetooth.framework CoreData.framework
CoreFoundation.framework CoreGraphics.framework CoreImage.framework CoreLocation.framework
CoreMIDI.framework CoreMedia.framework CoreMotion.framework CoreSpotlight.framework CoreTelephony.framework
CoreText.framework CoreVideo.framework EventKit.framework EventKitUI.framework ExternalAccessory.framework
Foundation.framework GLKit.framework GSS.framework GameController.framework GameKit.framework
GameplayKit.framework HealthKit.framework HealthKitUI.framework HomeKit.framework IOKit.framework
ImageIO.framework Intents.framework IntentsUI.framework JavaScriptCore.framework LocalAuthentication.framework
MapKit.framework MediaAccessibility.framework MediaPlayer.framework MediaToolbox.framework
MessageUI.framework Messages.framework Metal.framework MetalKit.framework
MetalPerformanceShaders.framework MobileCoreServices.framework ModelIO.framework
MultipeerConnectivity.framework NetworkExtension.framework NewsstandKit.framework NotificationCenter.framework
OpenAL.framework OpenGLES.framework PassKit.framework Photos.framework PhotosUI.framework
PushKit.framework QuartzCore.framework QuickLook.framework ReplayKit.framework SafariServices.framework
SceneKit.framework Security.framework Social.framework Speech.framework SpriteKit.framework StoreKit.framework
System.framework SystemConfiguration.framework Twitter.framework UIKit.framework UserNotifications.framework
UserNotificationsUI.framework VideoSubscriberAccount.framework VideoToolbox.framework
WatchConnectivity.framework WebKit.framework iAd.framework
from objc_util import *
UIScreen = ObjCClass('UIScreen')
screen = UIScreen.mainScreen()
if screen.brightness() < 0.3:
screen.setBrightness_(0.6)
else:
screen.setBrightness_(0.1)
from objc_util import *
def DemoClass_foo_(_self, _cmd, _s):
print('result: %s' % ObjCInstance(_s))
# NSObject
DemoClass = create_objc_class(
'DemoClass',
ObjCClass('NSObject'),
methods=[DemoClass_foo_],
protocols=[])
demo_obj = DemoClass.alloc().init()
demo_obj.foo_("hello")
result: hello
def DemoClass_foo_(_self, _cmd, _s): ...
def bar_baz_(_self, _cmd, _x1, _x2): ...
DemoClass = create_objc_class(
...
methods=[DemoClass_foo_, bar_baz_],
...
demo_obj = DemoClass.alloc().init()
demo_obj.foo_("hello")
demo_obj.bar_baz_(2, 3)
demo_obj.bar_(2, baz=5)
# UIColor.colorWithRed:green:blue:alpha
UIColor.colorWithRed(1.0, green=0.0,
blue=0.0, alpha=1.0)
UIColor.color(red=1.0, green=0.0, blue=0.0,
alpha=1.0)
from objc_util import ObjCClass
def is_word_valid(word):
reflib =
ObjCClass('UIReferenceLibraryViewController')
return reflib.dictionaryHasDefinitionForTerm_(word)
test_words = ['foo', 'bar', 'quuz', 'cat', 'dog']
for word in test_words:
print('%s: %s' % (word, is_word_valid(word)))
foo: False
bar: True
quuz: False
cat: True
dog: True
https://gist.github.com/omz/599ef8aeae22620261c6
from objc_util import *
UIApplication = ObjCClass('UIApplication')
vc =
UIApplication.sharedApplication().keyWindow
().rootViewController()
print(vc.childViewControllers())
<b'__NSArrayI': (
"<UINavigationController: 0x1038db200>",
"<PA2TabViewController: 0x104003000>",
"<PA2AccessoryTabViewController: 0x1038dac00>"
)>
Pythonista
• objc_util
• iOS Framework
• ObjCClass ObjCInstance
Python
•
•
•
IoT
• cb
• BLE
• CoreBluetooth
• Sony MESH
https://youtu.be/uJ6VVklLUQc
https://github.com/jbking/pythonista-misc/blob/master/mesh/button_demo.py
• objc_util
• SpriteKit
(SKPhysicsBody)
https://youtu.be/rS6FHvKrU6Y
https://github.com/jbking/pythonista-misc/blob/master/spritekit/skview-demo.py
•
• ui, Requests
•
• appex, webbrowser,
(pythonista://ScriptName)
tips
•
• view.present(hide_title_bar=True)
•
• CPU
• GPU
•
• Omz gist
• https://gist.github.com/omz/
• Pythonista Tools
• https://github.com/Pythonista-Tools/Pythonista-
Tools
Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Square869120 contest #2
Square869120 contest #2Square869120 contest #2
Square869120 contest #2AtCoder Inc.
 
論文の図表レイアウト例
論文の図表レイアウト例論文の図表レイアウト例
論文の図表レイアウト例Sunao Hara
 
Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.
Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.
Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.kiki utagawa
 
ドット絵でプログラミング!難解言語『Piet』勉強会
ドット絵でプログラミング!難解言語『Piet』勉強会ドット絵でプログラミング!難解言語『Piet』勉強会
ドット絵でプログラミング!難解言語『Piet』勉強会京大 マイコンクラブ
 
Scapyで作る・解析するパケット
Scapyで作る・解析するパケットScapyで作る・解析するパケット
Scapyで作る・解析するパケットTakaaki Hoyo
 
LR parsing
LR parsingLR parsing
LR parsingichikaz3
 
充足可能性問題のいろいろ
充足可能性問題のいろいろ充足可能性問題のいろいろ
充足可能性問題のいろいろHiroshi Yamashita
 
ラムダ計算入門
ラムダ計算入門ラムダ計算入門
ラムダ計算入門Eita Sugimoto
 
動的計画法の並列化
動的計画法の並列化動的計画法の並列化
動的計画法の並列化Proktmr
 
Python入門 : 4日間コース社内トレーニング
Python入門 : 4日間コース社内トレーニングPython入門 : 4日間コース社内トレーニング
Python入門 : 4日間コース社内トレーニングYuichi Ito
 
普通のプログラミング言語R
普通のプログラミング言語R普通のプログラミング言語R
普通のプログラミング言語RShuyo Nakatani
 
簡単な算数でできる文章校正
簡単な算数でできる文章校正簡単な算数でできる文章校正
簡単な算数でできる文章校正hirokiky
 
Stochastic Variational Inference
Stochastic Variational InferenceStochastic Variational Inference
Stochastic Variational InferenceKaede Hayashi
 
静的型つき組版処理システムSATySFi @第61回プログラミング・シンポジウム
静的型つき組版処理システムSATySFi @第61回プログラミング・シンポジウム静的型つき組版処理システムSATySFi @第61回プログラミング・シンポジウム
静的型つき組版処理システムSATySFi @第61回プログラミング・シンポジウムT. Suwa
 
Jupyter notebook 이해하기
Jupyter notebook 이해하기 Jupyter notebook 이해하기
Jupyter notebook 이해하기 Yong Joon Moon
 
Shinyユーザのための非同期プログラミング入門
Shinyユーザのための非同期プログラミング入門Shinyユーザのための非同期プログラミング入門
Shinyユーザのための非同期プログラミング入門hoxo_m
 

Was ist angesagt? (20)

Square869120 contest #2
Square869120 contest #2Square869120 contest #2
Square869120 contest #2
 
論文の図表レイアウト例
論文の図表レイアウト例論文の図表レイアウト例
論文の図表レイアウト例
 
Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.
Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.
Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.
 
ドット絵でプログラミング!難解言語『Piet』勉強会
ドット絵でプログラミング!難解言語『Piet』勉強会ドット絵でプログラミング!難解言語『Piet』勉強会
ドット絵でプログラミング!難解言語『Piet』勉強会
 
Scapyで作る・解析するパケット
Scapyで作る・解析するパケットScapyで作る・解析するパケット
Scapyで作る・解析するパケット
 
LR parsing
LR parsingLR parsing
LR parsing
 
RMQ クエリ処理
RMQ クエリ処理RMQ クエリ処理
RMQ クエリ処理
 
充足可能性問題のいろいろ
充足可能性問題のいろいろ充足可能性問題のいろいろ
充足可能性問題のいろいろ
 
ラムダ計算入門
ラムダ計算入門ラムダ計算入門
ラムダ計算入門
 
動的計画法の並列化
動的計画法の並列化動的計画法の並列化
動的計画法の並列化
 
Python入門 : 4日間コース社内トレーニング
Python入門 : 4日間コース社内トレーニングPython入門 : 4日間コース社内トレーニング
Python入門 : 4日間コース社内トレーニング
 
双対性
双対性双対性
双対性
 
普通のプログラミング言語R
普通のプログラミング言語R普通のプログラミング言語R
普通のプログラミング言語R
 
深層強化学習と実装例
深層強化学習と実装例深層強化学習と実装例
深層強化学習と実装例
 
簡単な算数でできる文章校正
簡単な算数でできる文章校正簡単な算数でできる文章校正
簡単な算数でできる文章校正
 
直交領域探索
直交領域探索直交領域探索
直交領域探索
 
Stochastic Variational Inference
Stochastic Variational InferenceStochastic Variational Inference
Stochastic Variational Inference
 
静的型つき組版処理システムSATySFi @第61回プログラミング・シンポジウム
静的型つき組版処理システムSATySFi @第61回プログラミング・シンポジウム静的型つき組版処理システムSATySFi @第61回プログラミング・シンポジウム
静的型つき組版処理システムSATySFi @第61回プログラミング・シンポジウム
 
Jupyter notebook 이해하기
Jupyter notebook 이해하기 Jupyter notebook 이해하기
Jupyter notebook 이해하기
 
Shinyユーザのための非同期プログラミング入門
Shinyユーザのための非同期プログラミング入門Shinyユーザのための非同期プログラミング入門
Shinyユーザのための非同期プログラミング入門
 

Ähnlich wie Pythonistaで始めるiOSプロトタイプ開発

APIs in production - we built it, can we fix it?
APIs in production - we built it, can we fix it?APIs in production - we built it, can we fix it?
APIs in production - we built it, can we fix it?Martin Gutenbrunner
 
手機自動化測試和持續整合
手機自動化測試和持續整合手機自動化測試和持續整合
手機自動化測試和持續整合Carl Su
 
LTから入門するPython開発環境 #PyLadiesTokyo
LTから入門するPython開発環境 #PyLadiesTokyoLTから入門するPython開発環境 #PyLadiesTokyo
LTから入門するPython開発環境 #PyLadiesTokyoHidenori Matsuki
 
Xcodeを用いた iPhone/iPadアプリ開発
Xcodeを用いた iPhone/iPadアプリ開発Xcodeを用いた iPhone/iPadアプリ開発
Xcodeを用いた iPhone/iPadアプリ開発一樹 濱崎
 
Xcodeを用いたiPhone/iPadアプリ開発
Xcodeを用いたiPhone/iPadアプリ開発Xcodeを用いたiPhone/iPadアプリ開発
Xcodeを用いたiPhone/iPadアプリ開発ashphy
 
Python. Why to learn?
Python. Why to learn?Python. Why to learn?
Python. Why to learn?Oleh Korkh
 
みゆっき☆Think#4 「こんどはiPhoneに触ってみるよ!」
みゆっき☆Think#4 「こんどはiPhoneに触ってみるよ!」みゆっき☆Think#4 「こんどはiPhoneに触ってみるよ!」
みゆっき☆Think#4 「こんどはiPhoneに触ってみるよ!」techtalkdwango
 
Pythonistaの使い方
Pythonistaの使い方Pythonistaの使い方
Pythonistaの使い方Yusuke Muraoka
 
Python to go
Python to goPython to go
Python to goWeng Wei
 
Why the Internet of Things will be built on Open Source
Why the Internet of Things will be built on Open SourceWhy the Internet of Things will be built on Open Source
Why the Internet of Things will be built on Open SourceAndy Piper
 
Try EarlGrey | 20161118 iOS Test Night
Try EarlGrey | 20161118 iOS Test NightTry EarlGrey | 20161118 iOS Test Night
Try EarlGrey | 20161118 iOS Test Nightichiko_revjune
 
OSINT tools for security auditing [FOSDEM edition]
OSINT tools for security auditing [FOSDEM edition] OSINT tools for security auditing [FOSDEM edition]
OSINT tools for security auditing [FOSDEM edition] Jose Manuel Ortega Candel
 
Introduction to python history and platforms
Introduction to python history and platformsIntroduction to python history and platforms
Introduction to python history and platformsKirti Verma
 
Speedupiosdevelopment
SpeedupiosdevelopmentSpeedupiosdevelopment
Speedupiosdevelopmentslidepaddemo
 

Ähnlich wie Pythonistaで始めるiOSプロトタイプ開発 (20)

APIs in production - we built it, can we fix it?
APIs in production - we built it, can we fix it?APIs in production - we built it, can we fix it?
APIs in production - we built it, can we fix it?
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
 
手機自動化測試和持續整合
手機自動化測試和持續整合手機自動化測試和持續整合
手機自動化測試和持續整合
 
LTから入門するPython開発環境 #PyLadiesTokyo
LTから入門するPython開発環境 #PyLadiesTokyoLTから入門するPython開発環境 #PyLadiesTokyo
LTから入門するPython開発環境 #PyLadiesTokyo
 
Xcodeを用いた iPhone/iPadアプリ開発
Xcodeを用いた iPhone/iPadアプリ開発Xcodeを用いた iPhone/iPadアプリ開発
Xcodeを用いた iPhone/iPadアプリ開発
 
Applebu
ApplebuApplebu
Applebu
 
Applebu
ApplebuApplebu
Applebu
 
Xcodeを用いたiPhone/iPadアプリ開発
Xcodeを用いたiPhone/iPadアプリ開発Xcodeを用いたiPhone/iPadアプリ開発
Xcodeを用いたiPhone/iPadアプリ開発
 
Python. Why to learn?
Python. Why to learn?Python. Why to learn?
Python. Why to learn?
 
みゆっき☆Think#4 「こんどはiPhoneに触ってみるよ!」
みゆっき☆Think#4 「こんどはiPhoneに触ってみるよ!」みゆっき☆Think#4 「こんどはiPhoneに触ってみるよ!」
みゆっき☆Think#4 「こんどはiPhoneに触ってみるよ!」
 
Pythonistaの使い方
Pythonistaの使い方Pythonistaの使い方
Pythonistaの使い方
 
Python to go
Python to goPython to go
Python to go
 
Why the Internet of Things will be built on Open Source
Why the Internet of Things will be built on Open SourceWhy the Internet of Things will be built on Open Source
Why the Internet of Things will be built on Open Source
 
Introduction to the Python
Introduction to the PythonIntroduction to the Python
Introduction to the Python
 
Try EarlGrey | 20161118 iOS Test Night
Try EarlGrey | 20161118 iOS Test NightTry EarlGrey | 20161118 iOS Test Night
Try EarlGrey | 20161118 iOS Test Night
 
OSINT tools for security auditing [FOSDEM edition]
OSINT tools for security auditing [FOSDEM edition] OSINT tools for security auditing [FOSDEM edition]
OSINT tools for security auditing [FOSDEM edition]
 
Ik in action
Ik in actionIk in action
Ik in action
 
Python 1
Python 1Python 1
Python 1
 
Introduction to python history and platforms
Introduction to python history and platformsIntroduction to python history and platforms
Introduction to python history and platforms
 
Speedupiosdevelopment
SpeedupiosdevelopmentSpeedupiosdevelopment
Speedupiosdevelopment
 

Mehr von Yusuke Muraoka

いかにして問題をとくか
いかにして問題をとくかいかにして問題をとくか
いかにして問題をとくかYusuke Muraoka
 
私のPythonとの関わりかた
私のPythonとの関わりかた私のPythonとの関わりかた
私のPythonとの関わりかたYusuke Muraoka
 
Substance D world-plone-day-2017
Substance D world-plone-day-2017Substance D world-plone-day-2017
Substance D world-plone-day-2017Yusuke Muraoka
 
Gunma.web #24 MySQL HA
Gunma.web #24 MySQL HAGunma.web #24 MySQL HA
Gunma.web #24 MySQL HAYusuke Muraoka
 
The Substance D - Plone Symposium Tokyo 2015
The Substance D - Plone Symposium Tokyo 2015The Substance D - Plone Symposium Tokyo 2015
The Substance D - Plone Symposium Tokyo 2015Yusuke Muraoka
 
プロパティディスクリプタとその拡張ライブラリ
プロパティディスクリプタとその拡張ライブラリプロパティディスクリプタとその拡張ライブラリ
プロパティディスクリプタとその拡張ライブラリYusuke Muraoka
 
Debug it-python-hack-a-thon-2011.02
Debug it-python-hack-a-thon-2011.02Debug it-python-hack-a-thon-2011.02
Debug it-python-hack-a-thon-2011.02Yusuke Muraoka
 
App Engineと非同期とテストと私
App Engineと非同期とテストと私App Engineと非同期とテストと私
App Engineと非同期とテストと私Yusuke Muraoka
 
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 PythonYusuke Muraoka
 

Mehr von Yusuke Muraoka (14)

いかにして問題をとくか
いかにして問題をとくかいかにして問題をとくか
いかにして問題をとくか
 
私のPythonとの関わりかた
私のPythonとの関わりかた私のPythonとの関わりかた
私のPythonとの関わりかた
 
Substance D world-plone-day-2017
Substance D world-plone-day-2017Substance D world-plone-day-2017
Substance D world-plone-day-2017
 
Gunma.web #24 MySQL HA
Gunma.web #24 MySQL HAGunma.web #24 MySQL HA
Gunma.web #24 MySQL HA
 
The Substance D - Plone Symposium Tokyo 2015
The Substance D - Plone Symposium Tokyo 2015The Substance D - Plone Symposium Tokyo 2015
The Substance D - Plone Symposium Tokyo 2015
 
プロパティディスクリプタとその拡張ライブラリ
プロパティディスクリプタとその拡張ライブラリプロパティディスクリプタとその拡張ライブラリ
プロパティディスクリプタとその拡張ライブラリ
 
Django learning Part2
Django learning Part2Django learning Part2
Django learning Part2
 
Django learning
Django learningDjango learning
Django learning
 
Poolboy
PoolboyPoolboy
Poolboy
 
Pyramid Security
Pyramid SecurityPyramid Security
Pyramid Security
 
Some about chef
Some about chefSome about chef
Some about chef
 
Debug it-python-hack-a-thon-2011.02
Debug it-python-hack-a-thon-2011.02Debug it-python-hack-a-thon-2011.02
Debug it-python-hack-a-thon-2011.02
 
App Engineと非同期とテストと私
App Engineと非同期とテストと私App Engineと非同期とテストと私
App Engineと非同期とテストと私
 
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
 

Kürzlich hochgeladen

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Kürzlich hochgeladen (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Pythonistaで始めるiOSプロトタイプ開発

  • 4.
  • 5. Pythonista • Pythonista: A full-featured Python environment for iOS devices • europython 2014 https://ep2014.europython.eu/en/ schedule/sessions/109/ • Pythonista Pythonista 
 iOS Pythonista • https://pycon.jp/2016/ja/schedule/presentation/47/ PyCon JP 2016 • Pythonista • PyCon mini Kumamoto
  • 6. (1) • • • Pythonista iOS • iOS Pythonista • • NumPy SymPy, SimPy, Matplotlib • StaSh • , Git
  • 7. (2) • • iOS Python • • Python • Objective-C • iOS
  • 8. Pythonista iOS • • Xcode • • AppStore ? • • Xcode https://github.com/omz/ PythonistaAppTemplate • Python
  • 9. Pythonista iOS • Pythonista Python • iOS Framework Python • •
  • 11. • Pythonista • • (BLE) • iOS • ( , C/S) • GPIO •
  • 12. • Python • NG • iOS Pythonista • objc_util • ( Framework … ) • •
  • 15. Framework from objc_util import * NSBundle.bundleWithPath_('/System/Library/ Frameworks/Photos.framework').load() AVFoundation.framework AVKit.framework Accelerate.framework Accounts.framework AdSupport.framework AddressBook.framework AddressBookUI.framework AssetsLibrary.framework AudioToolbox.framework AudioUnit.framework CFNetwork.framework CallKit.framework CloudKit.framework Contacts.framework ContactsUI.framework CoreAudio.framework CoreAudioKit.framework CoreBluetooth.framework CoreData.framework CoreFoundation.framework CoreGraphics.framework CoreImage.framework CoreLocation.framework CoreMIDI.framework CoreMedia.framework CoreMotion.framework CoreSpotlight.framework CoreTelephony.framework CoreText.framework CoreVideo.framework EventKit.framework EventKitUI.framework ExternalAccessory.framework Foundation.framework GLKit.framework GSS.framework GameController.framework GameKit.framework GameplayKit.framework HealthKit.framework HealthKitUI.framework HomeKit.framework IOKit.framework ImageIO.framework Intents.framework IntentsUI.framework JavaScriptCore.framework LocalAuthentication.framework MapKit.framework MediaAccessibility.framework MediaPlayer.framework MediaToolbox.framework MessageUI.framework Messages.framework Metal.framework MetalKit.framework MetalPerformanceShaders.framework MobileCoreServices.framework ModelIO.framework MultipeerConnectivity.framework NetworkExtension.framework NewsstandKit.framework NotificationCenter.framework OpenAL.framework OpenGLES.framework PassKit.framework Photos.framework PhotosUI.framework PushKit.framework QuartzCore.framework QuickLook.framework ReplayKit.framework SafariServices.framework SceneKit.framework Security.framework Social.framework Speech.framework SpriteKit.framework StoreKit.framework System.framework SystemConfiguration.framework Twitter.framework UIKit.framework UserNotifications.framework UserNotificationsUI.framework VideoSubscriberAccount.framework VideoToolbox.framework WatchConnectivity.framework WebKit.framework iAd.framework
  • 16. from objc_util import * UIScreen = ObjCClass('UIScreen') screen = UIScreen.mainScreen() if screen.brightness() < 0.3: screen.setBrightness_(0.6) else: screen.setBrightness_(0.1)
  • 17. from objc_util import * def DemoClass_foo_(_self, _cmd, _s): print('result: %s' % ObjCInstance(_s)) # NSObject DemoClass = create_objc_class( 'DemoClass', ObjCClass('NSObject'), methods=[DemoClass_foo_], protocols=[]) demo_obj = DemoClass.alloc().init() demo_obj.foo_("hello") result: hello
  • 18. def DemoClass_foo_(_self, _cmd, _s): ... def bar_baz_(_self, _cmd, _x1, _x2): ... DemoClass = create_objc_class( ... methods=[DemoClass_foo_, bar_baz_], ... demo_obj = DemoClass.alloc().init() demo_obj.foo_("hello") demo_obj.bar_baz_(2, 3) demo_obj.bar_(2, baz=5) # UIColor.colorWithRed:green:blue:alpha UIColor.colorWithRed(1.0, green=0.0, blue=0.0, alpha=1.0) UIColor.color(red=1.0, green=0.0, blue=0.0, alpha=1.0)
  • 19. from objc_util import ObjCClass def is_word_valid(word): reflib = ObjCClass('UIReferenceLibraryViewController') return reflib.dictionaryHasDefinitionForTerm_(word) test_words = ['foo', 'bar', 'quuz', 'cat', 'dog'] for word in test_words: print('%s: %s' % (word, is_word_valid(word))) foo: False bar: True quuz: False cat: True dog: True https://gist.github.com/omz/599ef8aeae22620261c6
  • 20. from objc_util import * UIApplication = ObjCClass('UIApplication') vc = UIApplication.sharedApplication().keyWindow ().rootViewController() print(vc.childViewControllers()) <b'__NSArrayI': ( "<UINavigationController: 0x1038db200>", "<PA2TabViewController: 0x104003000>", "<PA2AccessoryTabViewController: 0x1038dac00>" )> Pythonista
  • 21.
  • 22.
  • 23. • objc_util • iOS Framework • ObjCClass ObjCInstance Python • • •
  • 24.
  • 25. IoT • cb • BLE • CoreBluetooth • Sony MESH https://youtu.be/uJ6VVklLUQc https://github.com/jbking/pythonista-misc/blob/master/mesh/button_demo.py
  • 27. • • ui, Requests • • appex, webbrowser, (pythonista://ScriptName)
  • 29. • Omz gist • https://gist.github.com/omz/ • Pythonista Tools • https://github.com/Pythonista-Tools/Pythonista- Tools