To solve this optimization problem, we first need to translate the given conditions into mathematical expressions. Let's denote:

- $T$ as the number of televisions sold.
- $S$ as the number of speakers sold.

Given information:
1. The cost of a television is $400, and the cost of a speaker is $200.
2. The total budget for purchasing televisions and speakers is $25,000.
3. The store must sell at least 20 televisions but no more than 75 televisions: $20 \leq T \leq 75$.
4. The number of speakers sold is at most half the number of televisions sold: $S \leq \frac{1}{2}T$.
5. The profit per television sold is $400, and the profit per speaker sold is $250.

The objective is to maximize profit. The total cost for purchasing $T$ televisions and $S$ speakers can be represented as $400T + 200S$. The total revenue from selling them would be $400T + 250S$, assuming the profit per item is the selling price minus the cost, but since we're directly given profits, these will serve as our revenues for optimization purposes.

However, to correctly formulate this as a linear programming problem where we aim to maximize profit, we should consider that the "profit" mentioned is actually the revenue generated from selling each item after accounting for its cost. Thus, the actual objective function to maximize would be based on the revenues minus costs (which are given directly as profits).

The correct formulation considering profit maximization (where profit = revenue - cost) and given our "profits" are already post-cost, would simply be to maximize $400T + 250S$, subject to the constraints:

1. Budget constraint: $400T + 200S \leq 25000$
2. Television sales limits: $20 \leq T \leq 75$
3. Speaker sales limit relative to televisions: $S \leq 0.5T$

Let's now express this problem in Gurobi Python code:

```python
from gurobipy import *

# Create a new model
m = Model("Electronics_Store_Profit_Optimization")

# Decision variables
T = m.addVar(name='Televisions', vtype=GRB.CONTINUOUS, lb=20, ub=75)
S = m.addVar(name='Speakers', vtype=GRB.CONTINUOUS)

# Objective function: Maximize profit
m.setObjective(400*T + 250*S, GRB.MAXIMIZE)

# Constraints
m.addConstr(400*T + 200*S <= 25000, name='Budget_Constraint')
m.addConstr(S <= 0.5*T, name='Speaker_Sales_Limit')

# Solve the model
m.optimize()

# Print solution
if m.status == GRB.OPTIMAL:
    print(f"Optimal Solution: Televisions = {T.x}, Speakers = {S.x}")
    print(f"Maximum Profit: {m.ObjVal}")
else:
    print("No optimal solution found")
```