For more information on concepts covered in this lesson, you can check out:
How to Improve Your Workflow
00:04 Now that you’ve seen how to write, edit, and execute Python files in IDLE, it’s time to speed up your workflow. The IDLE editor offers a few features that you’ll see in most professional IDEs to help you code faster.
00:52 The developers of Python agreed on a standard style for well-written Python code, and this includes rules on indentation, whitespace, and more. This standard style was formalized and is now known as PEP 8.
01:14 Wriiting code can be a complex process. There’s a lot to remember, and getting help when you need it can be the difference between getting your code working quickly or having a frustrating time. IDLE can help in two main ways here.
Firstly, call tips. A call tip is like a hint for a certain part of your code to help you remember what that element needs. After you type the left parentheses to bring in a function call, a call tip will appear if you don’t type anything for a few seconds. Here, The call tip for
The other area where IDLE can help is code completion. One particularly useful area is finding functions within modules. For instance, here the
math module has been imported, and pressing Tab or waiting for a second or so shows the available functions. If you’ve already typed some letters, pressing Tab will take the pop-up to an entry that matches those letters.
02:36 This is particularly useful when you’re scrolling through a lengthy file and need to keep track of where you are while reviewing code in the editor. To turn it on, select Options → Show Code Context in the menu bar.
02:49 You’ll see a gray bar appear at the top of the editor window. On-screen, you can see part of the standard library being viewed. As the code is scrolled through, the context is retained in the gray bars at the top, sometimes to multiple levels deep.
03:15 To turn on line numbers, go to Options → Show Line Numbers. Often showing line numbers can be useful in longer or more complex code, allowing you to navigate around your code more easily and also pinpoint any issues that you may have.
Become a Member to join the conversation.