Strategy. Execution. The Strategy - Mostly we use logic using Python to make entry trade and exit trade when certain conditions are met. To get that conditions one will be needing access to live price. The strategy also might need access to previous orders, pending orders, portfolio, holdings, etc. to make decisions.
The Execution - The code needs to place the order through the broker.