-
-
Save mfcallahan/6ac515e792a45fb8b4f2795403ee9ed7 to your computer and use it in GitHub Desktop.
Delete all ".pitemx" and ".pitem" files which are automatically downloaded when clicking the "Open in ArcMap/ArcGIS Pro" button in ArcGIS Online.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from pathlib import Path | |
def main(): | |
path = os.path.join(Path.home(), "Downloads") | |
proFileExt = ".pitemx" | |
arcMapFileExt = ".pitem" | |
for file in os.listdir(path): | |
if file.endswith(proFileExt) or file.endswith(arcMapFileExt): | |
try: | |
os.remove(os.path.join(path, file)) | |
except OSError: | |
# Ignore errors | |
pass | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment