Can we call python function in solidity smart contract. If yes, how we can test it please? I'm using remix for the smart contract development.

1 Answer 1


Python and Solidity are two very different programming languages. There is no standard way to call into Python code from Solidity.

Your best bet will probably be to port the code from Python to Solidity. Or, if you'd like, to Vyper which has much more similar syntax to Python.

P.S. Theoretically you could do some hacks like either writing a Python interpreter in Solidity, or running an existing Python interpreter binary on a MIPS (or otherwise) implementation in Solidity, but you probably don't want to do that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.