Nginx 配置文件解析器 python-nginx

码农软件 · 软件分类 · XML相关工具 · 2019-09-17 16:12:25

软件介绍

python-nginx , Nginx 配置文件解析器。

用法示例:

#!/usr/bin/env python
# encoding: utf-8

from parser import Parser
from config import Config

# just 4 test
if "__main__" == __name__:
    # 配置文件路径
    path = r'./default'

    # 结构化后的配置内容
    data = Parser().loadf(path)
    # print data

    # 对配置内容的操作通过 config 实例
    config = Config(path)

    # 一些操作示例
    # print config.find(('upstream', 'http')).toggle('server', '8000').gen_config()
    # print config.find('http', 'server').append("addtional", "string").remove("additional", "string").gen_config()

    # 保存配置内容至制定文件
    # config.savef(r'./default.result')

本文地址:https://www.codercto.com/soft/d/14805.html

Natural Language Processing with Python

Natural Language Processing with Python

Steven Bird、Ewan Klein、Edward Loper / O'Reilly Media / 2009-7-10 / USD 44.99

This book offers a highly accessible introduction to Natural Language Processing, the field that underpins a variety of language technologies, ranging from predictive text and email filtering to autom......一起来看看 《Natural Language Processing with Python》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

SHA 加密
SHA 加密

SHA 加密工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试