Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-10721

Python tutorials are not compatible with Python 3

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 6.20/04
    • Fix Version/s: 6.22/00
    • Component/s: PyROOT
    • Labels:
      None
    • Environment:

      macOS 10.15.4

      ROOT 6.20/02

      Python 3.7.6

    • Development:

      Description

      $ pwd
      /usr/local/root-6.20.04/tutorials/pyroot
      $ ipython
      Python 3.7.6 (default, Dec 30 2019, 19:38:26) 
      Type 'copyright', 'credits' or 'license' for more information
      IPython 7.13.0 -- An enhanced Interactive Python. Type '?' for help.In [1]: %run demo                                                               
      ---------------------------------------------------------------------------
      NameError                                 Traceback (most recent call last)
      /usr/local/root-6.20.00/obj/tutorials/pyroot/demo.py in <module>
           62    rep = ''
           63    while not rep in [ 'q', 'Q' ]:
      ---> 64       rep = raw_input( 'enter "q" to quit: ' )
           65       if 1 < len(rep):
           66          rep = rep[0]NameError: name 'raw_input' is not defined
      In [2]:
      

       It would be great to make the PyROOT tutorials compatible with Python 3 because many new users now prefer Python 3 to Python 2.

      I had a ROOT lecture yesterday for undergraduates, and tried to show how PyROOT works very similarly to C++ ROOT, but demo.py was not Python 3 compatible.

      I have not tested all the Python scripts in the directory.

        Attachments

          Activity

            People

            • Assignee:
              gallim Massimiliano Galli
              Reporter:
              5634f7f540ef3ba1605e oxon@mac.com
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: