Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Python から.net DLL を呼び出す
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
tsuda.a
December 30, 2022
Programming
1.4k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Python から.net DLL を呼び出す
Python (Iron Python ではなく、普通のいわゆる cPython (ver3系)) で .net core の DLL を呼び出してみた例です。
tsuda.a
December 30, 2022
More Decks by tsuda.a
See All by tsuda.a
Git を GUI で使う話
tsudaahr
0
150
マジカルインクリメントと指数表記
tsudaahr
0
300
バックアップしていますか?
tsudaahr
0
170
RDB以前のファイル設計の話でもしようか(ぇ
tsudaahr
0
180
NPUわからん
tsudaahr
0
240
計算量オーダーの話
tsudaahr
1
490
クラウド初学者が抱える不安について
tsudaahr
0
480
キューとは何か
tsudaahr
0
310
等幅は死んだ(ぇ
tsudaahr
0
160
Other Decks in Programming
See All in Programming
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
350
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
4.9k
Modernizing iOS Apps
seyfoyun
0
140
AI Augmentation Techniques with Liberty
ivargrimstad
0
240
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
220
Next.js: The final boss of Web Performance
guaca
0
370
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
190
Kotlinの15年とServer-Side Kotlin
n_takehata
1
190
golang-bob.pdf
iwatsukayura
0
150
ActionController meets Protocol Buffers
sorah
1
770
Kotlinize Is Not Just Converting to Kotlin
chigichan24
1
210
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
1.6k
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
Large-scale JavaScript Application Architecture
addyosmani
516
110k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
620
30 Presentation Tips
portentint
PRO
1
450
How to build a perfect <img>
jonoalderson
1
6.2k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
570
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
47k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
880
Test your architecture with Archunit
thirion
2
2.5k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
300
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
490
Transcript
Python から .net DLL を 呼び出す すごい広島 .rb with Python[69]
オンライン LTDD 2022-12 #1 @tsuda_ahr
準備 pip install pythonnet ※ .net core のインストールは済んでいるものとします
Visual Studio で dll を作成 (.net core で作ります) namespace PythonTestNamespace
{ public class PythonTestClass { public int Add(int value1, int value2) { return value1 + value2; } } }
Python のコードを書く from pythonnet import load Load(“coreclr”) import clr clr.AddReference('PythonTest')
from PythonTestNamespace import PythonTestClass test = PythonTestClass() ver = test.Add(1, 2) print(ver) .net core の CLR を使用 (これを書かないと .net framework になる) DLL を Load Class を Import
同じフォルダに配置
実行
よって ライブラリロジックは C# で書いて、それを Python で操ることが可能!
そんなことをして何が楽しいのか?
Powershell (pwsh) からでも使えるよ!
C# DLL WindowsApp Python Powershell Excel VBA つまりいろんな環境から呼び出せる。 Winows Only
Winows or Linux or Mac
デメリット? • たぶん激烈に遅い(計測はしていません)
ご清聴ありがとうございました。