Categories
Cryptocurrency Ethereum Mastering Development

Execute smart contract function on python

so I already successfully make a smart contract and deployed it on my BC network. I can execute the function using the Ethereum wallet. My question is, how can I execute the functions on Python language? For example, here is one function of my SC:

function withdrawToken(address recipient, uint value) returns (bool success) { 
    if (int(tokens[recipient] - value) < 0) { 
        tokens[recipient] = 0; 
    } else { 
        tokens[recipient] -= value; 
    } 
    OnValueChanged(recipient, tokens[recipient]); 
    return true; 
} 

For making a transaction in Python language, I’m using web3 library and it’s also already worked. I’ll really appreciate your help, thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *