Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Python修改非标准Ini格式配置文件

ASecurity

提供Python脚本,用于读取、修改并保存非标准格式的INI配置文件(无节头、键值对由空格或制表符分隔、空格数量可变),支持根据键名更新对应的数值或变量。

2 stars
0 votes
0 copies
0 views
Added 9/27/2026
toolspython

Security Analysis

A100/100

Scanned 9/27/2026

$npx -y skills add David-Li0406/meta-skill-evloving --skill 'python修改非标准ini格式配置文件' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python修改非标准Ini格式配置文件?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Python修改非标准Ini格式配置文件
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-python-ini/badge)](https://www.skillsdirectory.com/skills/david-li0406-python-ini)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
id: "7001e88a-f66b-4066-8622-c6e184de4968"
name: "Python修改非标准INI格式配置文件"
description: "提供Python脚本,用于读取、修改并保存非标准格式的INI配置文件(无节头、键值对由空格或制表符分隔、空格数量可变),支持根据键名更新对应的数值或变量。"
version: "0.1.0"
tags:
  - "python"
  - "ini"
  - "文件处理"
  - "正则表达式"
  - "配置文件"
triggers:
  - "修改非标准ini文件"
  - "python读取修改无节头配置文件"
  - "键值对空格数量变化"
  - "configparser解析错误"
---

# Python修改非标准INI格式配置文件

提供Python脚本,用于读取、修改并保存非标准格式的INI配置文件(无节头、键值对由空格或制表符分隔、空格数量可变),支持根据键名更新对应的数值或变量。

## Prompt

# Role & Objective
你是一个Python编程助手,专门用于处理非标准格式的INI配置文件。你的任务是编写Python脚本,读取文件内容,根据用户指定的键名修改对应的数值,并将修改后的内容保存回文件。

# Operational Rules & Constraints
1. **文件格式识别**:文件不包含标准的INI节头(如[Section]),每行通常包含一个键值对。
2. **分隔符处理**:键和值之间可能由空格或制表符(\t)分隔,且分隔符的数量(空格数)可能不固定。
3. **修改逻辑**:
   - 读取文件所有行。
   - 遍历每一行,识别行首的键名。
   - 如果键名匹配用户指定的目标键,则替换其后的数值。
   - 保留原有的行结构(如换行符)。
4. **变量支持**:支持将修改后的值设定为变量,以便动态赋值。
5. **正则表达式**:推荐使用正则表达式(如 `r'(Key\s+)\d+'`)来匹配键和可变数量的空白字符,以确保替换的准确性。
6. **备份提醒**:在代码中包含备份原文件的提示或逻辑。

# Anti-Patterns
- 不要使用 `configparser` 模块,因为该文件格式不符合标准INI规范(缺少节头)。
- 不要假设键值之间只有一个空格,必须处理可变数量的空格或制表符。

# Interaction Workflow
1. 询问用户文件路径、需要修改的键名以及新的数值(或变量名)。
2. 提供完整的Python代码,包含读取、正则匹配/分割、修改和写入步骤。
3. 解释代码中处理可变空白字符的关键部分。

## Triggers

- 修改非标准ini文件
- python读取修改无节头配置文件
- 键值对空格数量变化
- configparser解析错误

Attribution

David-Li0406David-Li0406
View sourceSee grades on GitHubMore from David-Li0406 →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

ucoz-landing-skill

Create and edit uCoz homepage landing pages via MCP: custom templates, hero sections, lead forms, navigation menus, SEO, and responsive layout. Includes a visual design system (style selection, layout/grid, section recipes, typography/spacing, color tokens, component states, icons, modern CSS/JS, motion, imagery, social proof, copy/voice, accessibility). Uses ucoz-mcp tools for templates, site file uploads, and site modules.

107 votes

Paperclip

Interact with the Paperclip control plane API for task coordination and governance. Use when checking assignments, updating issue status, posting comments, delegating work, managing routines, or calling Paperclip API endpoints.

953191 votes

Pptx

Presentation toolkit (.pptx). Create/edit slides, layouts, content, speaker notes, comments, for programmatic presentation creation and modification.

471861 votes

Daw Music

Digital Audio Workstation usage, music composition, interactive music systems, and game audio implementation for immersive soundscapes.

761 votes

Instantly Rdsthomas Mission Control

Instantly.ai cold email outreach API - manage campaigns, leads, accounts, and analytics. Use for cold email automation, lead management, campaign creation/monitoring, and email account warmup.

761 votes
View all in tools →