Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3e47ee0

Browse filesBrowse files
Salil VanvariNelleV
Salil Vanvari
authored andcommitted
Examples have been made python3 compliant
1 parent a481143 commit 3e47ee0
Copy full SHA for 3e47ee0

File tree

Expand file treeCollapse file tree

3 files changed

+11
-5
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+11
-5
lines changed

‎examples/misc/multiprocess.py

Copy file name to clipboardExpand all lines: examples/misc/multiprocess.py
+1-4Lines changed: 1 addition & 4 deletions
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
@@ -76,10 +77,6 @@ def main():
7677
for ii in range(10):
7778
pl.plot()
7879
time.sleep(0.5)
79-
try:
80-
input = raw_input
81-
except NameError:
82-
pass
8380
input('press Enter...')
8481
pl.plot(finished=True)
8582

‎examples/pylab_examples/griddata_demo.py

Copy file name to clipboardExpand all lines: examples/pylab_examples/griddata_demo.py
+3-1Lines 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

Copy file name to clipboardExpand all lines: examples/widgets/lasso_selector_demo.py
+7Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.