# WithEntrypoint

- Module: [Aspire.Hosting.Python](/reference/api/go/aspire.hosting.python.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: [`PythonAppResource`](/reference/api/go/aspire.hosting.python/pythonappresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

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
func (PythonAppResource) 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()`.

## Applies to

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