Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8de60af

Browse files
Salil VanvariNelleV
Salil Vanvari
authored andcommitted
Examples have been made python3 compliant
1 parent e1c76f6 commit 8de60af

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

examples/misc/multiprocess.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Demo of using multiprocessing for generating data in one process and plotting
33
# in another.
44
# Written by Robert Cimrman
5+
from six.moves import input
56

67
from __future__ import print_function
78
import time
@@ -82,7 +83,7 @@ def main():
8283
for ii in range(10):
8384
pl.plot()
8485
time.sleep(0.5)
85-
raw_input('press Enter...')
86+
input('press Enter...')
8687
pl.plot(finished=True)
8788

8889
if __name__ == '__main__':

examples/pylab_examples/griddata_demo.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
from matplotlib.mlab import griddata
33
import matplotlib.pyplot as plt
44
import numpy as np
5+
from six.moves import input
6+
57
# make up data.
6-
#npts = int(raw_input('enter # of random points to plot:'))
8+
#npts = int(input('enter # of random points to plot:'))
79
seed(0)
810
npts = 200
911
x = uniform(-2, 2, npts)

examples/widgets/lasso_selector_demo.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
from matplotlib.path import Path
99

1010

11+
try:
12+
raw_input
13+
except NameError:
14+
# Python 3
15+
raw_input = input
16+
17+
1118
class SelectFromCollection(object):
1219
"""Select indices from a matplotlib collection using `LassoSelector`.
1320

0 commit comments

Comments
 (0)