File: rm_pyc.py

package info (click to toggle)
python-fs 2.4.16-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,944 kB
  • sloc: python: 13,048; makefile: 226; sh: 3
file content (16 lines) | stat: -rw-r--r-- 240 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""
Remove all pyc files in a directory.

Usage:

    python rm_pyc.py <PATH or FS URL>

"""

import sys

from fs import open_fs

with open_fs(sys.argv[1]) as fs:
    count = fs.glob("**/*.pyc").remove()
print(f"{count} .pyc files remove")