Tag Archive for 'Python'

Page 2 of 3

Edit your code in IPython

IPython makes it easy to edit source code, or create new scripts based on a couple of lines in your history, or paste examples from the web. Continue reading ‘Edit your code in IPython’

System commands from IPython

You can make use of your Python skills by interacting with system commands directly for things like file renaming, directory restructuring, or calling any arbitrary system command from within IPython. Here are some ways to do that. Continue reading ‘System commands from IPython’

Shortcuts in IPython

For the pathologically lazy, there are some shortcuts in IPython to save you from typing often-used commands.
Continue reading ‘Shortcuts in IPython’

History: keep track of your work in IPython

This post shows the different ways of keeping track of your work in IPython: the command history, saving the history (or parts of the history to file) for later use, and storing variables so you don’t have to create them next time you use IPython. Continue reading ‘History: keep track of your work in IPython’

Managing variables in IPython

After working in IPython for a while, sometimes you’d like to use a variable you created way back at the beginning, but you don’t remember exactly what it was called. Here are some useful commands for working with variables in IPython. Continue reading ‘Managing variables in IPython’

Running a program in IPython

Running programs or scripts in IPython is easy, and here are the commands to use. Continue reading ‘Running a program in IPython’

Directory navigation in IPython

A reference table of commands to use when navigating directories in IPython. Continue reading ‘Directory navigation in IPython’

Getting help in IPython

IPython has an in-depth integrated help system. You can get help on IPython’s magic functions, view documentation from a single function, check out syntax-highlighted source code, or enter the Python interactive help system. Here’s a list of the commands to use. Continue reading ‘Getting help in IPython’

Create a second y-axis in matplotlib

Today I was trying to figure out how to plot two time series with differently scaled values. I found two_scales.py example in the matplotlib examples which describes how to do it.

Here’s a slightly simplified version of the code, and afterward a detailed explanation of what’s going on. Continue reading ‘Create a second y-axis in matplotlib’

Learning Python

There are a lot of tutorials out there to get started in Python. Here I’ve highlighted what I consider to be the best ones: complete, well written, well paced, and assume no prior knowledge of programming. Some walk you through the installation of Python, while others take you through the finer points of the language.
Continue reading ‘Learning Python’