Move away from Python Interop for better stability

This commit is contained in:
2026-03-09 17:11:59 -07:00
parent 52c5062d6e
commit ac67be137c
8 changed files with 134 additions and 60 deletions
+14 -2
View File
@@ -1,7 +1,19 @@
import sys
import yfinance as yf
def getCurrentPrice(symbol):
def getCurrentPrice():
# Get the Symbol from ARGV
symbol = sys.argv[1]
ticker = yf.Ticker(symbol)
data = ticker.history(period="1d", interval="1m")
current_price = data['Close'].iloc[-1]
return current_price
# Return to C# via stdout
print(f"---RESULT_START---")
print(current_price)
print(f"---RESULT_END---")
if __name__ == "__main__":
getCurrentPrice()