Rootlogon script when running PyROOT

Which rootlogon.C script is called when I do:

(in python)
from ROOT import *


It seems that PyROOT ignores my .rootrc file in my current directory, and it seems to not care about $ROOTSYS/etc/system.rootrc . I’d like to have the same default settings (like canvas fill color, statistics box setup, etc) for when I use ROOT and PyROOT. How can I make this happen?



sorry for replying so late, but I’ve been away.

There appear to be two questions in your message, one in the title about “rootlogon” and one in the text about “rootrc”. The latter should not be ignored (and isn’t AFAIK), the former is ignored. Some code like:import ROOT, os ROOT.gROOT.Macro( os.path.expanduser( '~/.rootlogon.C' ) )
Should do it. It’s an old request to have that code in, but I couldn’t make up my mind what to do: rootlogon.C,, or a combination or … I better get to it to define something sensible.



some code is in svn now; you should be able to pick up the bindings/pyroot/ file only and use it as a drop-in replacement.

It’s not as straightforward as I would have liked: rootlogon.C can not be executed until all ROOT globals have been created. This is deferred in PyROOT in order to allow the user to switch to batch mode, and hence loading of rootlogon is deferred as well.

The code will execute ~/, if available, and if not, it will go through the .C one, if available.

Hope this is what you wanted …