# CodeGeneration **Repository Path**: br66/code-generation ## Basic Information - **Project Name**: CodeGeneration - **Description**: 此代码生成插件根据python jinja模块编写,非常的简单灵活,可以根据自己的需求更改 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-04-18 - **Last Updated**: 2023-04-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # codegeneration-allcode ## 代码生成插件介绍 此代码生成插件引用python [jinja模块](https://github.com/pallets/jinja)编写,非常的简单灵活,可以根据自己的需求更改 ## 如何使用 1.安装python3.9\ 2.pip install -U Jinja2\ 3.git clone https://github.com/265525/codegeneration-allcode.git \ 4.运行demo.py ## 例子 ``` from utils.templatebase import TemplateInit # home生成 home = TemplateInit() home.render("index.txt",context={"title":"home测试1"}) # user模块生成 user = TemplateInit() user.setdirPath("user") user.render("index.txt",context={"title":"一层yser测试2"}) # user下的login模块生成 user.setdirPath("user/login") user.render("login.txt",context={"content":"二层user测试3"}) ``` ## MIT License Copyright (c) 2023 br66