Skip to content

Instantly share code, notes, and snippets.

@abersheeran
Last active May 31, 2022 07:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abersheeran/1c929dfa764dfdd49fa64a588af29ee9 to your computer and use it in GitHub Desktop.
Save abersheeran/1c929dfa764dfdd49fa64a588af29ee9 to your computer and use it in GitHub Desktop.
Determines whether a string is a Windows path.
import re
is_windows_path = lambda path: bool(re.compile(r"^[a-zA-Z]:").match(path))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment