Skip to main content
 首页 » 编程设计

python之删除冒号后的数字

2025年05月04日17Leo_wl

<分区>

我有一个文件如下:

1:01 
4:04 
7:07 
5:05 
3:03 

一般模式是<a number>:0<the same number before colon> .我想删除冒号和冒号后的所有内容。这会产生。

1 
4 
7 
5 
3 

在 bash 或 python 中实现此目的的简单方法是什么。