Python uses IPython to improve development efficiency

Source: Internet
Author: User
This article details how to use ipython in python to improve code development efficiency. it is very helpful for you to use python. if you need it, you can refer to it for reference. I. INTRODUCTION to IPython

IPython is an interactive Python interpreter and is more efficient.

Unlike most traditional working modes (edit-> compile-> run), it adopts the following working modes: Execution-> exploration, while most of the generation related to data analysis

Code contains exploratory operations (such as trial and iteration methods), so IPython can greatly improve the coding efficiency.

Since the development of IPython, it is not just an enhanced version of Python shell, it integrates the GUI console, which allows you to directly perform drawing operations; it also has a Web-based notebook and a lightweight fast parallel computing engine.

2. write code

Enter ipython in Terminal to start IPython.
If you need to use the Matplotlib library, you need to mark the integration of the Matplotlib package at startup, then the startup command is changed to: ipython -- pylab

1. learn to use the Tab key

When you enter the code, if this is a previously entered content (such as the variable defined earlier ), you only need to press the Tab key after entering the first few letters to automatically complete.
IPython has this function as a major improvement to the standard Python shell, which is already very common in IDE in other languages.

It can not only automatically complete variables and objects, but also automatically complete the file path as if you typed the command in Terminal.

2. press the up and down arrow keys to quickly enter history commands.

When a command or code needs to be repeatedly input, you do not have to manually repeat it each time. you only need to use the up arrow to automatically complete the previous command; then press the arrow key to run the preceding command.

If you need to press the arrow key multiple times to find a command, you only need to enter the first few letters of the command and then press the arrow key to filter only the commands that match the first few letters.

3. execute a. py file.

If you want to execute an external. py file, use the % run command, for example:

For more Python articles about how to use IPython to improve development efficiency, please follow the PHP Chinese network!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.