> For the complete documentation index, see [llms.txt](https://smallso.gitbook.io/tencent-cloud-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://smallso.gitbook.io/tencent-cloud-sdk/python-docs/serverless-functions/class-and-method/function-code/use-local-zip-archive.md).

# use\_local\_zip\_archive 方法

## 简要

配置使用本机硬盘上的 ZIP 压缩档案文件作为无服务器云函数源代码来源。

```python
def use_local_zip_archive(self,
    local_file_path: str
)
```

## 参数

该方法具有以下参数，其参数、参数类型和参数描述如下：

| 参数                | 类型  | 必选 | 描述                   |
| ----------------- | --- | -- | -------------------- |
| local\_file\_path | str | 是  | 本机硬盘上的 ZIP 压缩档案文件路径。 |

## 返回值

该方法返回当前代表无服务器云函数源代码配置的 [FunctionCode](https://smallso.gitbook.io/tencent-cloud-sdk/python-docs/serverless-functions/class-and-method/function-code) 类实例本身。

## 异常

该方法可能会主动引发的异常类型如下：

#### ValueError

参数值或类型不符合预期。

#### IOError

给定 ZIP 压缩档案文件不存在或无法读取。

## 示例

下面我们将通过一段 Python 代码向您演示如何使用该方法：

```python
functions.FunctionCode.use_local_zip_archive(
    local_file_path = './source.zip'
)
```

## 适用于

#### Tencent Cloud SDK for Python

产品软件包：tencent-cloud-sdk-serverless-functions >= 0.1.1


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://smallso.gitbook.io/tencent-cloud-sdk/python-docs/serverless-functions/class-and-method/function-code/use-local-zip-archive.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
