syntax error in python

L

Lalit

Hi
I am executing following commands.True
------------working fine but for below statement it is giving syntax
error.
SyntaxError: invalid syntax

any idea what is incorrect in my syntax
 
L

Lalit

Hi
I am executing following commands.>>> test = os.path.isfile('c:\\src\\kasjdfl.txt')

True
------------working fine but for below statement it is giving syntax
error.


SyntaxError: invalid syntax

any idea what is incorrect in my syntax

oops got the mistake I was nt ending if with :
sorry and thanks
 
T

Tim Roberts

Lalit said:
Hi
I am executing following commands.
True
------------working fine but for below statement it is giving syntax
error.

SyntaxError: invalid syntax

any idea what is incorrect in my syntax

You know that this is not C, and that the parentheses are not needed in the
"if" statement? In my opinion, they interfere with readability.
 

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,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top