On this page
  1. glob.escape
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

glob.escape

Up: glob | Next: glob.glob
Rel: glob.glob, glob.iglob, glob.translate
Ref: docs.python.org — glob.escape
Tags: #public #python3 #stdlib #glob


Import

import glob
from glob import escape

Signature & Overview

glob.escape(pathname)

Escape all special characters.

Usage

import glob

assert glob.escape("file[1].txt") == "file[[]1].txt"

Gotchas

REPL Inspect

from glob import escape
help(escape)

Linked from

Related notes