{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 环境变量\n", "\n", "你可以设置以下环境变量来配置 NiceGUI:\n", "\n", "- `MATPLOTLIB`(默认值:`true`)可以设置为 `false` 以避免可能代价高昂的 Matplotlib 导入。这将使 `ui.pyplot` 和 `ui.line_plot` 不可用。\n", "- `NICEGUI_STORAGE_PATH`(默认值:本地 `\".nicegui\"`)可以设置为更改存储文件的位置。\n", "- `MARKDOWN_CONTENT_CACHE_SIZE`(默认值:`1000`):内存中缓存的 Markdown 内容片段的最大数量。\n", "- `RST_CONTENT_CACHE_SIZE`(默认值:`1000`):内存中缓存的 ReStructuredText 内容片段的最大数量。" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from nicegui import ui\n", "from nicegui.elements import markdown\n", "\n", "ui.label(f'Markdown content cache size is {markdown.prepare_content.cache_info().maxsize}')\n", "\n", "# ui.run()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "py311", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.7" } }, "nbformat": 4, "nbformat_minor": 2 }