第二次作业

这个作业属于哪个课程 https://edu.cnblogs.com/campus/zjlg/rjjc
这个作业的目标 实现一个命令行文本计数统计程序,能正确统计导入的txt文本中的字符数、单词数、句子数。
姓名-学号 吴申奥2022329301122
码云 https://gitee.com/wu-shen-olympics/zuoye.git
介绍
这是一个能够实现命令行文本计数统计的Python程序。
基础功能:能正确统计导入的纯英文txt文本中的字符数,单词数,句子数。
扩展功能:能正确统计导入的纯英文txt文本中的代码行、空行、注释行等,并提供相应命令接口。

使用方法说明:
基础功能
python wc.py -c file.txt # 统计字符数 python wc.py -w file.txt # 统计单词数 python wc.py -s file.txt # 统计句子数
拓展功能
python wc.py -l file.txt # 统计代码行数 python wc.py -e file.txt # 统计空行数 python wc.py -m file.txt # 统计注释行数

功能展示:
基础功能使用文本:
Life is too short to spend time with people who suck the happiness out of you. If someone wants you in their life, they’ll make room for you. You shouldn’t have to fight for a spot. Never, ever insist yourself to someone who continuously overlooks your worth. And remember, it’s not the people that stand by your side when you’re at your best, but the ones who stand beside you when you’re at your worst that are your true friends.
实现:

拓展功能:
拓展功能使用文本:
Life is too short to spend time with people who suck the happiness out of you. If someone wants you in their life, they’ll make
room for you. You shouldn’t have to fight for a spot. Never, ever insist yourself to someone who continuously overlooks your worth.

And remember, it’s not the people that stand by your side when you’re at your best, but the ones who stand beside you when you’re at your worst that are your true friends.

实现:

posted @ 2024-10-29 18:42  塔利斯议員  阅读(4)  评论(0编辑  收藏  举报