ROOT
v6-34
Reference Guide
Loading...
Searching...
No Matches
_tdirectory.pyzdoc
Go to the documentation of this file.
1
/**
2
\class TDirectory
3
\brief \parblock \endparblock
4
\htmlonly
5
<div class="pyrootbox">
6
\endhtmlonly
7
## PyROOT
8
9
It is possible to retrieve the content of a TDirectory object
10
just like getting items from a Python dictionary.
11
Moreover, once a subdirectory or object is accessed for the first time,
12
it is cached for later use.
13
For example, assuming `d` is a TDirectory instance:
14
\code{.py}
15
# Access a subdirectory
16
d["subdir"]
17
18
# We can go further down in the hierarchy of directories
19
d["subdir"]["subsubdir"]
20
21
# Access an object (e.g. a histogram) in the directory
22
d["obj"]
23
24
# ... or in a subdirectory
25
d["subdir"]["obj"]
26
27
# Wrong key: raises KeyError
28
d["wrongAttr"]
29
\endcode
30
31
Furthermore, TDirectory implements a `WriteObject` Python method which relies
32
on TDirectory::WriteObjectAny. This method is a no-op for TDirectory objects,
33
but it is useful for objects of TDirectory subclasses such as TDirectoryFile
34
and TFile, which inherit it. Please refer to the documentation of those classes
35
for more information.
36
\htmlonly
37
</div>
38
\endhtmlonly
39
*/
v634_TMP
pyzdoc
_tdirectory.pyzdoc
ROOT v6-34 - Reference Guide Generated on Sun Dec 15 2024 03:24:28 (GVA Time) using Doxygen 1.9.8