Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SyntaxError
#1
Hi
Would someone be able to identify my syntax error please?
Error:
print ( >> fdeg , "%.8f %.8f %.5f" % (xx[ii], yy[jj], deformation[jj, ii])) ^ SyntaxError: invalid syntax
Yoriz write Mar-20-2022, 11:33 PM:
Please post all code, output and errors (in their entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply
#2
Without using the python tags, I'm not sure I can tell where the error is pointing at. But I'm wondering what you are intending with the >> fdeg. What are the arrows supposed to indicate?
Reply
#3
I'm sorry I don't know as I'm trying to debug someone else's script. The chevron was under the gap before the >>.
Reply
#4
Those arrows are not valid Python.
Reply
#5
bolowfred Wrote:Those arrows are not valid Python.
The arrows were valid python in the Python 2 version of the print statement
print>>fileptr, "spam"
They are no longer valid in Python 3. The Python 3 version is
print("spam", file=fileptr)
bowlofred and stevendaprano like this post
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020