You can replace each alphabetic character c with [cC], via
import glob
def insensitive_glob(pattern):
def either(c):
return '[%s%s]' % (c.lower(), c.upper()) if c.isalpha() else c
return glob.glob(''.join(map(either, pattern)))
More Related Contents:
- How to terminate a python subprocess launched with shell=True
- How to use `subprocess` command with pipes
- Execute Python script via crontab
- Is it possible to change the Environment of a parent process in Python?
- Getting MAC Address
- Python pysftp get_r from Linux works fine on Linux but not on Windows
- fcntl substitute on Windows
- How to get PID by process name?
- Access Denied page with headless Chrome on Linux while headed Chrome works on windows using Selenium through Python
- Linux command-line call not returning what it should from os.system?
- Call Python script from bash with argument
- Simulate keystroke in Linux with Python
- How to make Python script run as service?
- How to update-alternatives to Python 3 without breaking apt?
- Trouble installing scipy in virtualenv on a amazon ec2 linux micro instance
- How to open a file with the standard application?
- Python script to list users and groups
- How to split a huge csv file based on content of first column?
- Tkinter.PhotoImage doesn’t not support png image
- Get all modules/packages used by a python project
- How can I send a signal from a python program?
- Extracting data from HTML table
- Get local network interface addresses using only proc?
- RTSP stream and OpenCV (Python)
- How do I check the operating system in Python?
- run a python script in terminal without the python command
- Setting LD_LIBRARY_PATH from inside Python
- kill process with python
- Move and zoom a tkinter canvas with mouse
- Dropping Root Permissions In Python