0

This line had an error:

 print('Already built: ' + str(deletedDirs) + ' servers')

On 't' in the word print. I deleted this one and then the line below it had a syntax error:

time.sleep(timeToSleep)

On 'e' And so on.... Help me please. It worked yesterday but today it does not.

1
  • 6
    python is not generating syntax errors. You are. Commented Sep 19, 2013 at 7:22

2 Answers 2

9

The line before the statement is missing a closing parenthesis, or curly or square bracket.

The lines you keep deleting are not the problem, but Python doesn't know this until it discovers that that next line makes no sense when it was looking for a comma or closing parenthesis instead.

Demo; there should be two closing parenthesis:

>>> some_function(str('with additional arg, but missing closing parens')
... print('Oops?')
  File "<stdin>", line 2
    print('Oops?')
        ^
SyntaxError: invalid syntax
Sign up to request clarification or add additional context in comments.

Comments

0
  1. check the file encoding
  2. check the indents

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.