🐍 .NETμ—μ„œ Python을 κ°€μž₯ κ°€λ³κ²Œ μ‹€ν–‰ν•˜λŠ” 방법

Python μ½”λ“œλ₯Ό C# μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ—μ„œ μ‹€ν–‰ν•΄μ•Ό ν•˜λŠ”λ°  λ³΅μž‘ν•œ μ„€μ •κ³Ό λ³΄μΌλŸ¬ν”Œλ ˆμ΄νŠΈ μ½”λ“œκ°€ λΆ€λ‹΄λ˜μ…¨λ‚˜μš”?

DotNetPyλ₯Ό λ§Œλ“€μ—ˆμŠ΅λ‹ˆλ‹€: βœ… Zero Boilerplate - GIL κ΄€λ¦¬λ‚˜ Source Generator λΆˆν•„μš” βœ… AOT μΉœν™”μ  - Native AOT μ‹œλ‚˜λ¦¬μ˜€λ₯Ό μœ„ν•΄ 섀계 βœ… μ΅œμ†Œν•œμ˜ λŸ¬λ‹ 컀브 - λͺ‡ μ€„λ‘œ Python μ‹€ν–‰ βœ… Apache 2.0 λΌμ΄μ„ μŠ€

Python ν‘œν˜„μ‹ 평가뢀터 λ³΅μž‘ν•œ 데이터 κ΅ν™˜κΉŒμ§€,  pythonnetμ΄λ‚˜ CSnakes보닀 훨씬 κ°€λ²Όμš΄ λŒ€μ•ˆμž…λ‹ˆλ‹€.

μ‚¬μš© μ˜ˆμ‹œ: Python.Initialize(pythonLibraryPath); var executor = Python.GetInstance(); var result = executor.Evaluate("sum([1,2,3,4,5])"); Console.WriteLine(result?.GetInt32()); // 15

πŸ”— GitHub: https://github.com/rkttu/dotnetpy

2

If you have a fediverse account, you can quote this note from your own instance. Search https://hackers.pub/ap/notes/019a2fe3-94d2-720e-8310-48370d4d56fa on your instance and quote it. (Note that quoting is not supported in Mastodon.)