# PythonAppResource.WithEntrypoint

- Module: [Aspire.Hosting.Python](/reference/api/go/aspire.hosting.python.md)
- Defined on: [PythonAppResource](/reference/api/go/aspire.hosting.python/pythonappresource.md)
- Version: `17.0.0`
- Kind: `method`

Configures the entrypoint for the Python application.

## Remarks

This method allows you to change the entrypoint configuration of a Python application after it has been created.
The command and arguments will be updated based on the specified entrypoint type:
- Script: Runs as `python <scriptPath>`
- Module: Runs as `python -m <moduleName>`
- Executable: Runs the executable directly from the virtual environment
Important: This method resets all command-line arguments. If you need to add arguments after changing
the entrypoint, call `WithArgs` after this method.

## Definition

```go
type PythonAppResource interface {
    // ... omitted for brevity
    WithEntrypoint(
        entrypointType EntrypointType,
        entrypoint string,
    ) PythonAppResource
}
```

## Signature

```go
WithEntrypoint(
    entrypointType EntrypointType,
    entrypoint string,
) PythonAppResource
```

## Parameters

- `entrypointType` ([`EntrypointType`](/reference/api/go/aspire.hosting.python/entrypointtype.md)) -- The type of entrypoint (Script, Module, or Executable).
- `entrypoint` (`string`) -- The entrypoint value (script path, module name, or executable name).

## Returns

[`PythonAppResource`](/reference/api/go/aspire.hosting.python/pythonappresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Defined on

- [PythonAppResource](/reference/api/go/aspire.hosting.python/pythonappresource.md) -- `handle`
