diff --git a/pyext/ctools/obsutils.py b/pyext/ctools/obsutils.py
index 6fd6ad2..eb8347a 100755
--- a/pyext/ctools/obsutils.py
+++ b/pyext/ctools/obsutils.py
@@ -18,7 +18,7 @@
# along with this program. If not, see .
#
# ==========================================================================
-import ctools
+from . import ctools
import gammalib
import math
diff --git a/scripts/obsutils.py b/scripts/obsutils.py
index c8acd13..a0df8d0 100644
--- a/scripts/obsutils.py
+++ b/scripts/obsutils.py
@@ -1,5 +1,5 @@
-print "The obsutils are moved under the ctools module."
-print "Please update your script to import from ctools, i.e:"
-print "from ctools import obsutils"
+print("The obsutils are moved under the ctools module.")
+print("Please update your script to import from ctools, i.e:")
+print("from ctools import obsutils")
from ctools.obsutils import *
diff --git a/scripts/tsmerge.py b/scripts/tsmerge.py
index 131bde7..a15bdf5 100644
--- a/scripts/tsmerge.py
+++ b/scripts/tsmerge.py
@@ -7,18 +7,18 @@ import glob
import json
def print_help():
- print ""
- print "tsmerge.py expects two keyword argumens: use via command line as follows"
- print "tsmerge.py files= outfile="
- print "-------------------------------------------------------------------------"
- print "*** \"outfile\" should be a path to a fits file"
- print "*** \"files\" should be either be:"
- print " - an ascii-file listing the files your want to merge"
- print " OR - a wildcard string describing the files for merging"
- print "-------------------------------------------------------------------------"
- print ""
- print "Example: python tsmerge,py files=tsmap*.fits outfile=tsmap.fits"
- print ""
+ print("")
+ print("tsmerge.py expects two keyword argumens: use via command line as follows")
+ print("tsmerge.py files= outfile=")
+ print("-------------------------------------------------------------------------")
+ print("*** \"outfile\" should be a path to a fits file")
+ print("*** \"files\" should be either be:")
+ print(" - an ascii-file listing the files your want to merge")
+ print(" OR - a wildcard string describing the files for merging")
+ print("-------------------------------------------------------------------------")
+ print("")
+ print("Example: python tsmerge,py files=tsmap*.fits outfile=tsmap.fits")
+ print("")
sys.exit(-1)
@@ -105,7 +105,7 @@ class maps:
self.maps[j][i] = addmaps[j][i]
# Unify error messages
def error(self,message):
- print "*** ERROR ***: "+message
+ print("*** ERROR ***: "+message)
sys.exit(-1)
@@ -149,7 +149,7 @@ if __name__ == "__main__":
# Initialise list of files
kwargs = get_kwargs(sys.argv[1:])
- if not kwargs.has_key("outfile") or not kwargs.has_key("files"):
+ if "outfile" not in kwargs or "files" not in kwargs:
print_help()
outfile = kwargs["outfile"]
files = kwargs["files"]