Hi Syrine,
I would suggest to use the AWS Lambda Connector module for this. Mendix Marketplace - AWS Lambda Connector.
Using this connector you can write your Python script in AWS Lambda and call it from your Mendix application.
I hope this helps you with your integration challenge.