## Problem Description and Formulation

The pharmacy needs to determine the optimal number of bottles of pills and cream to prepare in order to maximize profit, given the available time for weighing and packaging.

Let's define the decision variables:
- $x$: number of bottles of pills
- $y$: number of bottles of cream

The objective function to maximize profit is:
\[ \text{Maximize:} \quad 50x + 60y \]

Subject to the constraints:
- Weighing time: $20x + 15y \leq 4000$
- Packaging time: $10x + 15y \leq 3000$
- Non-negativity: $x \geq 0, y \geq 0$

## Gurobi Code

```python
import gurobi

def solve_pharmacy_problem():
    # Create a new model
    model = gurobi.Model()

    # Define the decision variables
    x = model.addVar(lb=0, vtype=gurobi.GRB.CONTINUOUS, name="bottles_of_pills")
    y = model.addVar(lb=0, vtype=gurobi.GRB.CONTINUOUS, name="bottles_of_cream")

    # Define the objective function
    model.setObjective(50*x + 60*y, gurobi.GRB.MAXIMIZE)

    # Add the constraints
    model.addConstr(20*x + 15*y <= 4000, name="weighing_time")
    model.addConstr(10*x + 15*y <= 3000, name="packaging_time")

    # Optimize the model
    model.optimize()

    # Print the results
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal solution: x = {x.varValue}, y = {y.varValue}")
        print(f"Maximum profit: ${model.objVal:.2f}")
    else:
        print("No optimal solution found.")

# Run the function
solve_pharmacy_problem()
```

However, to adhere strictly to the format requested and provide a more accurate representation using the Gurobi Python API correctly, here is the revised version:

```python
from gurobi import *

def solve_pharmacy_problem():
    model = Model()

    x = model.addVar(lb=0, vtype=GRB.CONTINUOUS, name="bottles_of_pills")
    y = model.addVar(lb=0, vtype=GRB.CONTINUOUS, name="bottles_of_cream")

    model.setObjective(50*x + 60*y, GRB.MAXIMIZE)

    model.addConstr(20*x + 15*y <= 4000, name="weighing_time")
    model.addConstr(10*x + 15*y <= 3000, name="packaging_time")

    model.optimize()

    if model.status == GRB.OPTIMAL:
        print(f"Optimal solution: x = {x.varValue}, y = {y.varValue}")
        print(f"Maximum profit: ${model.objVal:.2f}")
    else:
        print("No optimal solution found.")

solve_pharmacy_problem()
```