SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Nils W. <nw...@me...> - 2004年02月01日 02:45:12
~/cvs/matplotlib/htdocs/screenshots> /usr/bin/python makeshots.py
Making screenshot simple_plot.py
Traceback (most recent call last):
 File "simple_plot.py", line 1, in ?
 from matplotlib.matlab import *
 File "/usr/local/lib/python2.1/site-packages/matplotlib/matlab.py",
line 109, in ?
 from mlab import *
 File "/usr/local/lib/python2.1/site-packages/matplotlib/mlab.py", line
147
 else: numFreqs = NFFT//2+1
 ^
SyntaxError: invalid syntax
From: LUK S. <shu...@po...> - 2004年02月01日 06:35:35
Nils Wagner wrote:
> ~/cvs/matplotlib/htdocs/screenshots> /usr/bin/python makeshots.py
> Making screenshot simple_plot.py
> Traceback (most recent call last):
> File "simple_plot.py", line 1, in ?
> from matplotlib.matlab import *
> File "/usr/local/lib/python2.1/site-packages/matplotlib/matlab.py",
> line 109, in ?
> from mlab import *
> File "/usr/local/lib/python2.1/site-packages/matplotlib/mlab.py", line
> 147
> else: numFreqs = NFFT//2+1
> ^
> SyntaxError: invalid syntax
> 
Not a syntax error any more in Python 2.3.
<quote>
In [1]: 3//2
Out[1]: 1
In [2]: 3/2
Out[2]: 1
In [3]: from __future__ import division
In [4]: 3//2
Out[4]: 1
In [5]: 3/2
Out[5]: 1.5
</quote>
Regards,
ST
--
From: John H. <jdh...@ac...> - 2004年02月01日 16:33:06
>>>>> "Nils" == Nils Wagner <nw...@me...> writes:
 Nils> ~/cvs/matplotlib/htdocs/screenshots> /usr/bin/python
 Nils> makeshots.py Making screenshot simple_plot.py Traceback
 Nils> (most recent call last): File "simple_plot.py", line 1, in ?
 Nils> from matplotlib.matlab import * File
 Nils> "/usr/local/lib/python2.1/site-packages/matplotlib/matlab.py",
 Nils> line 109, in ? from mlab import * File
 Nils> "/usr/local/lib/python2.1/site-packages/matplotlib/mlab.py",
 Nils> line 147 else: numFreqs = NFFT//2+1 ^ SyntaxError: invalid
 Nils> syntax
matplotlib requires python2.2, which supports 
 from __future__ import division
That line should be the on or near the first code line of
matplotlib/mlab.py. When this is imported, the integer division //
operator is defined.
See what's new in python2.2
http://www.python.org/doc/2.2.3/whatsnew/node7.html
I'm surprised you didn't get an error on the call to
from __future__ import division.
JDH
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /