diff --git a/python/examples/matplotlib_plot.py b/python/examples/matplotlib_plot.py index 972a035b4f..b8bdc287d6 100755 --- a/python/examples/matplotlib_plot.py +++ b/python/examples/matplotlib_plot.py @@ -86,4 +86,7 @@ lmp.command("run 0 pre no post yes") #print("Proc %d out of %d procs has" % (me,nprocs), lmp) if me == 0: - input("Press Enter to exit...") + if sys.version_info[0] == 3: + input("Press Enter to exit...") + else: + raw_input("Press Enter to exit...") diff --git a/python/examples/pizza/gnu.py b/python/examples/pizza/gnu.py index 1336e180e0..26dc0a5d5a 100644 --- a/python/examples/pizza/gnu.py +++ b/python/examples/pizza/gnu.py @@ -88,6 +88,7 @@ g.curve(N,'r') set color of curve N # Imports and external programs import os +import sys try: from DEFAULTS import PIZZA_GNUPLOT except ImportError: PIZZA_GNUPLOT = "gnuplot -p" @@ -122,7 +123,10 @@ class gnu: def enter(self): while 1: - command = input("gnuplot> ") + if sys.version_info[0] == 3: + command = input("gnuplot> ") + else: + command = raw_input("gnuplot> ") if command == "quit" or command == "exit": return self.__call__(command)