From 7d01b912b0695247c2af671aac7185ed5c7822f0 Mon Sep 17 00:00:00 2001 From: Sebastian Raschka Date: Tue, 29 Apr 2014 23:12:02 -0400 Subject: [PATCH] last cleanup for today --- README.md | 4 ++-- os_shutil_fileops | 22 ---------------------- 2 files changed, 2 insertions(+), 24 deletions(-) delete mode 100644 os_shutil_fileops diff --git a/README.md b/README.md index 24203e9..82f14a1 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -python_reference +Python Tutorials and References ================ -Syntax examples for useful Python functions, methods, and modules +Useful functions, tutorials, and other Python-related things ###Links to view the IPython Notebooks diff --git a/os_shutil_fileops b/os_shutil_fileops deleted file mode 100644 index d517f22..0000000 --- a/os_shutil_fileops +++ /dev/null @@ -1,22 +0,0 @@ -# sr 11/19/2013 -# common file operations in os and shutil modules - -import shutil -import os - -# Getting files of particular type from directory -files = [f for f in os.listdir(s_pdb_dir) if f.endswith(".txt")] - -# Copy and move -shutil.copyfile("/path/to/file", "/path/to/new/file") -shutil.copy("/path/to/file", "/path/to/directory") -shutil.move("/path/to/file","/path/to/directory") - -# Check if file or directory exists -os.path.exists("file or directory") -os.path.isfile("file") -os.path.isdir("directory") - -# Working directory and absolute path to files -os.getcwd() -os.path.abspath("file")