d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Python Synthax Error
Add Reply New Topic New Poll
Member
Posts: 7,232
Joined: Jan 31 2009
Gold: 0.30
May 29 2020 03:39pm
Using someone else's script I found online, but when I try to use it I get a syntax error, could anyone tell me what's wrong with it? This is the line that has the syntax error, but I can provide the whole script if needed. I'm completely new to python so I have no idea what any of that means lol.

Code
print >>opennew, "%s%s" % (word1,line[30:-1])openold.close()
opennew.close()
Member
Posts: 12,703
Joined: May 17 2013
Gold: 2,935.00
May 31 2020 04:02pm
looks like a python2 program

are you actually running it with python2?
Member
Posts: 7,232
Joined: Jan 31 2009
Gold: 0.30
Jun 1 2020 11:25am
Quote (Klexmoo @ May 31 2020 04:02pm)
looks like a python2 program

are you actually running it with python2?


Ah maybes thats it, the post with the script is from 2015 and the cluster I'm using has py3.6
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll