Note that, in addition to saving keystrokes on object names you’re working with, this is also helpful in exploring what methods an object contains (try hitting Tab after typing the period after the object’s name) or what objects a module contains (similar idea). And 3rd, if what you’ve typed so far doesn’t match anything in the namespace, then nothing will happen. 2nd, if there is only one possible option, the name will automatically be completed. You can then use the arrow keys or mouse to highlight the desired name, and press Tab to complete the name. 1st, if there are multiple objects whose names could match what you’ve typed so far, you will see a list options for you to choose from. When in the middle of typing something in the IPython console, such as the name of a variable, function, module, or any other object, try pressing Tab. Run file as Python program inside IPython session and make all file variables accessible Get more accurate execution time of statement by averaging many runsĭelete all defined variables in current namespace
Get execution time of statement based on single run If you use the %magic command though, check out the last section of this article to make sure you’re able to see all of the output.
Try them out, and try either the %quickref or %magic commands to learn more about how to use the rest of them. There are also special “magic” commands that you can use in the IPython console, which can take the effectiveness of Spyder to a whole new level. But there are some commands that only apply to the console, the most useful of which are the following: Up/DownĬtrl + C (or click red square in corner of pane)Ĭancel action, stop running script, KeyboardInterrupt
Keep in mind that many of these Code Editor shortcuts also apply to the IPython console. Go to file and line where selected object is defined Highlight to cursor’s new position on next line up/downįind text (Enter and Shift + Enter, or F3 and Shift + F3 to cycle matches)
So what I want to do here is show you the handful of shortcuts that are:
Not to mention that, if you’re a beginner, it’s going to be a while before your mind outpaces your fingers anyways. And importantly, the learning curve is gentle so you’ll be able to focus your cognitive resources on the code.
“Real Programmers” by xkcd, used under CC BY-NC 2.5, compressedīut you will avoid the mouse for the most part. To be clear, these aren’t the optimal shortcuts you’d get with something like Vim, and your hand will regularly have to venture over to the arrow keys and their neighbors. And below you’ll find a list of said keyboard shortcuts you can follow along with. If you’re interested, see the video above for a tour of Spyder where I run you through the basics, including a set of simple keyboard shortcuts. But otherwise it has a lot to offer with its blend of intuitive, beginner-friendly design and broad, powerful set of shoulders. Granted, it may not the best choice if you’re a full-time Python developer. Whether you’re a beginner programmer, casual coder, data analyst/scientist, or anyone else that uses Python, I’d recommend you at least check out Spyder, among other IDEs.