Not understanding this documentation

F

F.O.P.

http://bugs.python.org/issue5358
I simply installed 3.0 on my ubuntubox brought my project from a
windows machine and made necessary changes to what I had used from os
and os.path. I have an error at the end of this line:
for k in range(I):
and the error:
SyntaxError: invalid character in identifier

I've already declared I way above as the lenth of an array (I = len
(IA))
There shouldn't be a problem there aren't any issues with other
declarations identical to this.
 
R

Rhodri James

http://bugs.python.org/issue5358
I simply installed 3.0 on my ubuntubox brought my project from a
windows machine and made necessary changes to what I had used from os
and os.path. I have an error at the end of this line:
for k in range(I):
and the error:
SyntaxError: invalid character in identifier

I've already declared I way above as the lenth of an array (I = len
(IA))
There shouldn't be a problem there aren't any issues with other
declarations identical to this.

Could you show us slightly more of your code and the rest of the
error message, please? I have a suspicion that the error actually
lies in the "necessary changes" you made.
 
J

John Machin

http://bugs.python.org/issue5358
I simply installed 3.0 on my ubuntubox brought my project from a
windows machine and made necessary changes to what I had used from os
and os.path.  I have an error at the end of this line:
for k in range(I):
and the error:
SyntaxError: invalid character in identifier

I've already declared I way above as the lenth of an array (I = len
(IA))
There shouldn't be a problem there aren't any issues with other
declarations identical to this.

You are have used the --ftniv and --strict options and hence it's
objecting to the lower-case "k".
 
F

F.O.P.

Could you show us slightly more of your code and the rest of the
error message, please?  I have a suspicion that the error actually
lies in the "necessary changes" you made.

I spoke to a friend about it and he found that I had put in a unicode
"semicolon" rather than ASCII.
I feel silly for asking a question like this but there's really no
harm done in asking. Thank you for the quick response Rhodri! Much
appreciated!
Cheers
 
T

Terry Reedy

F.O.P. wrote:

Your subject line should have been about "SyntaxError message"

Why reference this? Unless you added zero-width joiners in the move,
this is irrelevant noise.
I simply installed 3.0 on my ubuntubox

Upgrade to 3.1 as soon as you can. Works better.
brought my project from a
windows machine and made necessary changes to what I had used from os
and os.path. I have an error at the end of this line:
for k in range(I):
and the error:
SyntaxError: invalid character in identifier

I've already declared I way above as the lenth of an array (I = len
(IA))
There shouldn't be a problem there aren't any issues with other
declarations identical to this.

I otherwise concur with R. James as there is no syntax error posted.
To make sure there is nothing invisible in that line, do
print(repr("for k in range(I):")) # should be no escaped chars and
print(len("for k in range(I):")) # should be 18, I believe

tjr
 
J

John Machin

I spoke to a friend about it and he found that I had put in a unicode
"semicolon" rather than ASCII.

This is rather puzzling. What are you describing as a "unicode
semicolon"? Possibilities include:

(a) U+003B SEMICOLON (which is exactly what you need)
(b) U+037E GREEK QUESTION MARK (which looks like (a))
(c) U+061B ARABIC SEMICOLON (which looks like (a) rotated 180 degrees)

How did you get it into your source file?

What was in your
# coding: ?????
or similar line at the top of your source file?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top