ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Functions
find_unique_file Namespace Reference
Functions
find_unique_file
(pattern)
Helper functions for input file handling.
Function Documentation
◆
find_unique_file()
find_unique_file
(
pattern
)
Helper functions for input file handling.
Definition at line
3
of file
find_unique_file.py
.
3
def
find_unique_file
(pattern):
4
"Return a matching file, provided it is unique"
5
import
glob
6
files = glob.glob(pattern)
7
8
if
not
files:
9
raise
RuntimeError(
"No '%s' file found"
% pattern)
10
elif
len(files) > 1:
11
raise
RuntimeError(
"More than one '%s' file found"
% pattern)
12
return
files[0]
13
find_unique_file
Definition
find_unique_file.py:1
Generated on
for ATLAS Offline Software by
1.17.0