1

This is my script:

def info():
  print '\n'.join(commands)

The exception highlights the print '\n' part but I can't see what's wrong.

5
  • 1
    When asking this type of question, you should definitely include the traceback. Commented Dec 22, 2013 at 8:28
  • What error exactly are you getting? Can you add the error message? Commented Dec 22, 2013 at 8:29
  • @BalthazarRouberol Sorry, this is my first post but thanks for the advice. Commented Dec 22, 2013 at 8:31
  • You can edit your question and include the trace back. Commented Dec 22, 2013 at 8:35
  • I got the answer I need now but I'll remember than the next time I ask a question. Commented Dec 22, 2013 at 8:38

1 Answer 1

3

If you use Python 3.x, print should be function form.

def info():
    print('\n'.join(commands))

BTW, commands is not passed as parameter. Then it refers to global varaible commands.

Sign up to request clarification or add additional context in comments.

1 Comment

@Hyperboreus, Ah.. I forgot free variable.

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.