Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I have a python script which uses some python libraries to do decrypting and encryption . Is there a way where I can invoke this script inside the webpart code.
No, SPFx web parts are entirely client side. You could however create an Azure function using Python and then expose an API that your SPFx web part could call: