Errors in code for root file

There is a code that is designed to consider a root file with a lot of events. The file itself is attached here. After the launch, the following warnings occur:

Error in <TFile::TFile>: file /home/erg/*.root does not exist
Traceback (most recent call last):
  File "/home/erg/PycharmProjects/pythonProject1/.idea/", line 1558, in <module>
    openimagefilename(0, True)
  File "/home/erg/PycharmProjects/pythonProject1/.idea/", line 761, in openimagefilename
  File "/home/erg/PycharmProjects/pythonProject1/.idea/", line 96, in readfileinitdata
    tempfile = ROOT.TFile.Open(filename)
  File "/home/erg/root/lib/ROOT/_pythonization/", line 67, in _TFileOpen
    raise OSError('Failed to open file {}'.format(str(args[0])))
OSError: Failed to open file /home/erg/*.root (76.1 KB)

_ROOT Version: 6.26/10
_Compiler: pycharm community

TFile does not accept wildcards, you have to pass only one file name to it. If you want to “concatenate” files, you can use TChain, which accepts wildcards when you Add files to the chain.

I changed * for real file name.
The code has a string:


But t need at least 1 arguments (0 given)
What i can do?


1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.