From 07b372ee4a31142c0bc38fe51408e4528f4500e1 Mon Sep 17 00:00:00 2001 From: Enric Tejedor Saavedra <enric.tejedor.saavedra@cern.ch> Date: Tue, 13 Dec 2016 11:11:54 +0100 Subject: [PATCH] Adapt to Python3 syntax: print --- bindings/pyroot/JupyROOT/cppcompleter.py | 12 ++++++------ bindings/pyroot/JupyROOT/handlers.py | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bindings/pyroot/JupyROOT/cppcompleter.py b/bindings/pyroot/JupyROOT/cppcompleter.py index d76fef83916..c3e81a5d443 100644 --- a/bindings/pyroot/JupyROOT/cppcompleter.py +++ b/bindings/pyroot/JupyROOT/cppcompleter.py @@ -35,7 +35,7 @@ class CppCompleter(object): >>> comp = CppCompleter() >>> comp.activate() >>> for suggestion in comp._completeImpl("TH1"): - ... print suggestion + ... print(suggestion) TH1 TH1C TH1D @@ -45,7 +45,7 @@ class CppCompleter(object): TH1K TH1S >>> for suggestion in comp._completeImpl("TH2"): - ... print suggestion + ... print(suggestion) TH2 TH2C TH2D @@ -58,20 +58,20 @@ class CppCompleter(object): TH2S >>> garbage = ROOT.gInterpreter.ProcessLine("TH1F* h") >>> for suggestion in comp._completeImpl("h->GetA"): - ... print suggestion + ... print(suggestion) h->GetArray h->GetAsymmetry h->GetAt h->GetAxisColor >>> garbage = ROOT.gInterpreter.ProcessLine("TH1F aa") >>> for suggestion in comp._completeImpl("aa.Add("): - ... print suggestion.replace("\\t"," ") + ... print(suggestion.replace("\\t"," ")) <BLANKLINE> Bool_t Add(TF1* h1, Double_t c1 = 1, Option_t* option = "") Bool_t Add(const TH1* h, const TH1* h2, Double_t c1 = 1, Double_t c2 = 1) // *MENU* Bool_t Add(const TH1* h1, Double_t c1 = 1) >>> for suggestion in comp._completeImpl("TROOT::Is"): - ... print suggestion + ... print(suggestion) IsA IsBatch IsEqual @@ -89,7 +89,7 @@ class CppCompleter(object): IsZombie >>> comp.deactivate() >>> for suggestion in comp._completeImpl("TG"): - ... print suggestion + ... print(suggestion) ''' def __init__(self): diff --git a/bindings/pyroot/JupyROOT/handlers.py b/bindings/pyroot/JupyROOT/handlers.py index a46c40454f7..ad780e3dc76 100644 --- a/bindings/pyroot/JupyROOT/handlers.py +++ b/bindings/pyroot/JupyROOT/handlers.py @@ -65,7 +65,7 @@ class Runner(object): ''' Asynchrously run functions >>> import time >>> def f(code): - ... print code + ... print(code) >>> r= Runner(f) >>> r.Run("ss") ss @@ -73,16 +73,16 @@ class Runner(object): ss >>> def g(msg): ... time.sleep(.5) - ... print msg + ... print(msg) >>> r= Runner(g) - >>> r.AsyncRun("Asynchronous");print "Synchronous";time.sleep(1) + >>> r.AsyncRun("Asynchronous");print("Synchronous");time.sleep(1) Synchronous Asynchronous - >>> r.AsyncRun("Asynchronous"); print r.HasFinished() + >>> r.AsyncRun("Asynchronous"); print(r.HasFinished()) False >>> time.sleep(1) Asynchronous - >>> print r.HasFinished() + >>> print(r.HasFinished()) True ''' def __init__(self, function): -- GitLab