Horje
python delete file with extension Code Example
python delete file with extension
import os

dir_name = "/Users/ben/downloads/"
test = os.listdir(dir_name)

for item in test:
    if item.endswith(".zip"):
        os.remove(os.path.join(dir_name, item))
python code to remove file extension
import os
print os.path.splitext("sample.txt")[0]
Source: kite.com
python delete file with extension
what about currently directory




Python

Related
python string exclude non alphabetical characters Code Example python string exclude non alphabetical characters Code Example
roots of quadratic equation in python Code Example roots of quadratic equation in python Code Example
wait for input python Code Example wait for input python Code Example
make column nullable django Code Example make column nullable django Code Example
scatter plot plotly Code Example scatter plot plotly Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7