python / python/cpython

Implement a clear() function directly into Python so that os doesn't have to be imported and become overkill for a project

未关闭
#95,785 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

interpreter-core type-feature
主要语言
Python
星标
77.2k
派生
36k
平均合并
1 天 9 小时
30 天内合并 PR
558

描述

Feature or enhancement

OS shouldn't need to be imported whenever you need to clear the screen. Why not just make a built-in Python function to clear the screen

Pitch

It should be able to be executed using a simple function such as clear() or cls(). It can be done for any OS using os.system('cls||clear')

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

未指定任何 CPython 源文件或测试。首先调查内置函数和跨平台终端行为是如何处理的,并以提出的 os.system('cls||clear') 方法作为背景。只有确定了 clear() 或 cls() API,并定义了各操作系统上的行为,才算完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
cli, operating-systems
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。