0

I want to call some existing python code (code that uses a neural network for object classification) with a solidity smart contract. On the front-end there has to be an image-input, then the classification gives the result true or false. This bool must be then stored in the smart contract. If a user accesses the "classify-function" in the smart contract, the classifier must be initiated for file-upload. After the file-upload the classification (in python) has to be done, the result must be stored as a smart-contract variable onchain. Is it possible to call a python function with a solidity function? And if yes, any hints or code snippets? Thanks

Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
HannesW
  • 11

1 Answers1

0

You cannot call Python function, or any function, with Solidity, because this is not how blockchains work. You are limited to execution within the EVM environment.

Please read details in this answer.

Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435