ROOT
v6-26
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
From Python, it is possible to inspect the content of a TDirectory object
10
as if the subdirectories and objects it contains were its attributes.
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 attribute: raises AttributeError
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
*/
v626_TMP
pyzdoc
_tdirectory.pyzdoc
ROOT v6-26 - Reference Guide Generated on Mon Sep 11 2023 21:03:04 (GVA Time) using Doxygen 1.9.8