Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README
------

* cwd.py: prints the current working directory

* cwdb.py: prints the current working directory as a binary string

* find-files.py: demonstrates how to list the files in the current
  directory according to a given pattern
  uses os and fnmatch, works with Python 2 and 3

* list-files.py: demonstrates how to list the files in the current
  directory using os.scandir()
  requires Python 3.6+

* find-files2.py: demonstrates how to list the files in the current
  directory using os.listdir and an iterator function
  works with Python 2 and 3

* find-files3.py: demonstrates how to list the files in the current
  directory using the subprocess module
  works with Python 2 and 3

  based on: Python module of the week: subprocess
  https://pymotw.com/2/subprocess/

* find-files4.py: demonstrates how to list the files in the current
  directory using the pathlib module
  works with Python 3

  based on: Python module of the week: pathlib
  https://pymotw.com/3/pathlib/

* find-files5.py: demonstrates how to list the files in the current
  directory using the pathlib module, and limit to specific files
  works with Python 3

  based on: Python module of the week: pathlib
  https://pymotw.com/3/pathlib/

* find-files6.py: uses os.walk to list the files
  works with both Python 2 and 3

* find-files6t.py: uses os.walk to list the files, and includes timeit
  to determine the execution time
  works with both Python 2 and 3

* find-test.sh: shell script to determine the execution time of a script

* mkdir.py: create a directory

* mkdir-ar.py: create a directory with specific access rights

* mkdir-p.py: create a directory with an entire path

* mkdir-temporary.py: create a temporary directory

* read-file-basic.py: reading a file in C/C++ style, and output line by
  line

* read-file-iterator.py: reading a file using iterator style, and output
  line by line

* read-file-full.py: read an entire file (version 1)

* read-file-full2.py: read an entire file (version 2)

* read-file-multiple-lines.py: reading a number of lines using the
  itertools module

* read-file-specific-line-1.py: read a specific line from a file, only

* read-file-specific-line-2.py: read a specific line from a file, only,
  using the linecache module

* read-file-with.py: reading a file using the with command, and output
  line by line

* rmdir.py: removing a single directory

* write-file-basic.py: writing a line of text to a file

* write-file-basic-with.py: writing a line of text to a file using the
  with statement

* write-file-buffer.py: writing a file buffer with line terminators to a
  file

* write-file-redirect.py: writing a line to a file via redirection (for
  Python 2.x)

* write-file-redirect2.py: writing a line to a file via redirection
  using the sys module, for all Python versions