python批處理replace後,最後一行字符串有些問題

一、背景css 使用python處理一些css文件,替換裏面的一些路徑。python 二、問題:使用如下代碼進行處理時,最後一行老是多出來一些字符串(多出來的字符串個數=替換先後相減後的差)指針 #-*-coding:utf-8-*- import os filepath = "./dist/" files = os.listdir(filepath) for file in files:
相關文章
相關標籤/搜索