NelsonGon
NelsonGon

Reputation: 13319

How to autocomplete brackets in spyder

new to python and spyder here. Is there a way to autocomplete brackets in spyder?!

Also is there a way to get auto indentation? I risk making this too broad but is there also a way to make sure that if say I'm defining a function, I can simply click at the end of the function without highlighting everything to make it run. Example:

def print_twice(Spam):
 print(Spam)
 print(Spam)

In the above I would like to run the last line but have spyder run everything from def print_twice(Spam) to print(Spam) Thanks and sorry if the question is annoying or already has an answer. Couldn't find it.

Upvotes: 1

Views: 1295

Answers (1)

Carlos Cordoba
Carlos Cordoba

Reputation: 34136

(Spyder maintainer here) My answers:

Is there a way to autocomplete brackets in spyder?

Brackets are auto-completed automatically by default.

Also is there a way to get auto indentation?

Auto-indentation works automatically too, after : or by aligning your code on open parenthesis.

is there also a way to make sure that if say I'm defining a function, I can simply click at the end of the function without highlighting everything to make it run[?]

No, but you can create a cell to run your function. Cells are regions in your code delimited by comments of the form # %% and you can run them with Ctrl+Enter (run cell and stay on it) or Shift+Enter (run cell and advance to next one).

Upvotes: 3

Related Questions