Home Backend Development Python Tutorial IPython 8.0 major version update supports code auto-completion

IPython 8.0 major version update supports code auto-completion

May 06, 2023 am 10:22 AM
Command Line code ipython 8.

IPython 8.0 大版本更新,支持代码自动补全

After more than 3 years of planning, IPython 8.0 is finally here.

Now, with the latest version, you can not only use Black to reformat the code in the command line, but also get a better automatic code completion and debugging experience.

IPython 8.0 大版本更新,支持代码自动补全

For more details, let’s read on.

Optimization Error

Before version 8.0, if an error occurred in the code, IPython's error traceback would display a hash value used to compile the Python AST, like this:

IPython 8.0 大版本更新,支持代码自动补全

#Now, the error traceback has been formatted correctly and can display the specific cell number where the bug is located.

IPython 8.0 大版本更新,支持代码自动补全

In addition, IPython 8.0 also integrates stack_data. This package provides more intelligent tracking information, which can highlight the AST nodes where errors occur and help quickly locate bugs.

For example, for a piece of code like this:

IPython 8.0 大版本更新,支持代码自动补全

If you call bar(), you will get an IndexError. IPython 8.0 will tell you where the index error occurs.

IPython 8.0 大版本更新,支持代码自动补全

Note: In the terminal and notebook, the location marked with ^ will be highlighted.

Another improvement that has a greater impact on productivity is to add a colon and line number after the file name of the error traceback.

IPython 8.0 大版本更新,支持代码自动补全

Many terminals and editors allow you to jump directly to the relevant file/line when using this syntax.

Automatic code completion suggestions

In addition to a better Debug experience, if you like the code automatic completion function in Ptpython, then now you can do it in IPython 8.0 It can also be used.

Accept these suggestions via ctrl-f, or ctrl-e, or by pressing the right arrow.

The alt-f shortcut key can only accept the first word of the suggestion.

Currently, auto-suggestions can only be displayed in emacs or vi mode.

Use "?" and "??" to view object information

In IPDB, you can now use "?" and "??" to display object information. The same goes for when using the IPython prompt:

IPython 8.0 大版本更新,支持代码自动补全

Auto-formatting with black in the CLI

If black is installed with The same environment as IPython, so now, terminal IPython will by default reformat command line (CLI) code wherever possible.

Of course, you can also use —TerminalInteractiveShell.autoformatter=None to disable this option.

History Scope Global Features

Previously, when using %history, users could specify the session and row:

IPython 8.0 大版本更新,支持代码自动补全

Or use global mode:

IPython 8.0 大版本更新,支持代码自动补全

But before 8.0, these two modes cannot be used at the same time. If the user specifies both modes, IPython will apply the global mode (globalize all history) and ignore the specified scope.

This feature is now enhanced so that if the user specifies both a range and a glob pattern, the glob pattern will be applied to the specified historical range.

If you want to know more information, here is the official website link:

​https://www.php.cn/link/003dd617c12d444ff9c80f717c3fa982​

By the way, I would like to remind you that if you want to use IPython 8.0, you must first upgrade Python to version 3.8 or above.

The above is the detailed content of IPython 8.0 major version update supports code auto-completion. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to solve win7 driver code 28 How to solve win7 driver code 28 Dec 30, 2023 pm 11:55 PM

Some users encountered errors when installing the device, prompting error code 28. In fact, this is mainly due to the driver. We only need to solve the problem of win7 driver code 28. Let’s take a look at what should be done. Do it. What to do with win7 driver code 28: First, we need to click on the start menu in the lower left corner of the screen. Then, find and click the "Control Panel" option in the pop-up menu. This option is usually located at or near the bottom of the menu. After clicking, the system will automatically open the control panel interface. In the control panel, we can perform various system settings and management operations. This is the first step in the nostalgia cleaning level, I hope it helps. Then we need to proceed and enter the system and

What to do if the blue screen code 0x0000001 occurs What to do if the blue screen code 0x0000001 occurs Feb 23, 2024 am 08:09 AM

What to do with blue screen code 0x0000001? The blue screen error is a warning mechanism when there is a problem with the computer system or hardware. Code 0x0000001 usually indicates a hardware or driver failure. When users suddenly encounter a blue screen error while using their computer, they may feel panicked and at a loss. Fortunately, most blue screen errors can be troubleshooted and dealt with with a few simple steps. This article will introduce readers to some methods to solve the blue screen error code 0x0000001. First, when encountering a blue screen error, we can try to restart

Learn how to use the command line tool sxstrace.exe effectively Learn how to use the command line tool sxstrace.exe effectively Jan 04, 2024 pm 08:47 PM

Many friends who use win10 system have encountered this problem when playing games or installing the system. The application cannot be started because the parallel configuration of the application is incorrect. For more information, see the application event log, or use the command line sxstrace.exe tool. This may be because the operating system does not have corresponding permissions. Let’s take a look at the specific tutorial below. Tutorial on using the command line sxstrace.exe tool 1. This problem usually occurs when installing programs and games. The prompt is: The application cannot be started because the parallel configuration of the application is incorrect. For more information, see the application event log, or use the command line sxstrace.exe tool. 2. Start →

The computer frequently blue screens and the code is different every time The computer frequently blue screens and the code is different every time Jan 06, 2024 pm 10:53 PM

The win10 system is a very excellent high-intelligence system. Its powerful intelligence can bring the best user experience to users. Under normal circumstances, users’ win10 system computers will not have any problems! However, it is inevitable that various faults will occur in excellent computers. Recently, friends have been reporting that their win10 systems have encountered frequent blue screens! Today, the editor will bring you solutions to different codes that cause frequent blue screens in Windows 10 computers. Let’s take a look. Solutions to frequent computer blue screens with different codes each time: causes of various fault codes and solution suggestions 1. Cause of 0×000000116 fault: It should be that the graphics card driver is incompatible. Solution: It is recommended to replace the original manufacturer's driver. 2,

Resolve code 0xc000007b error Resolve code 0xc000007b error Feb 18, 2024 pm 07:34 PM

Termination Code 0xc000007b While using your computer, you sometimes encounter various problems and error codes. Among them, the termination code is the most disturbing, especially the termination code 0xc000007b. This code indicates that an application cannot start properly, causing inconvenience to the user. First, let’s understand the meaning of termination code 0xc000007b. This code is a Windows operating system error code that usually occurs when a 32-bit application tries to run on a 64-bit operating system. It means it should

Detailed explanation of the causes and solutions of 0x0000007f blue screen code Detailed explanation of the causes and solutions of 0x0000007f blue screen code Dec 25, 2023 pm 02:19 PM

Blue screen is a problem we often encounter when using the system. Depending on the error code, there will be many different reasons and solutions. For example, when we encounter the problem of stop: 0x0000007f, it may be a hardware or software error. Let’s follow the editor to find out the solution. 0x000000c5 blue screen code reason: Answer: The memory, CPU, and graphics card are suddenly overclocked, or the software is running incorrectly. Solution 1: 1. Keep pressing F8 to enter when booting, select safe mode, and press Enter to enter. 2. After entering safe mode, press win+r to open the run window, enter cmd, and press Enter. 3. In the command prompt window, enter "chkdsk /f /r", press Enter, and then press the y key. 4.

Upgrade Ubuntu 20.04 to 22.04 via command line Upgrade Ubuntu 20.04 to 22.04 via command line Mar 20, 2024 pm 01:25 PM

This article details the steps to upgrade Ubuntu 20.04 to 22.04. For users using Ubuntu 20.04, they have missed the new features and advantages brought by version 22.04. In order to get a better experience and security, it is recommended to upgrade to a newer Ubuntu version in time. Ubuntu22.04 is codenamed "Jamie Jellyfish", let's explore how to get the latest LTS version! How to upgrade Ubuntu 20.04 to 22.04 via the command line Mastering the command line will give you an advantage. While it is possible to update Ubuntu via the GUI, our focus will be via the command line. First, let’s check the currently running version of Ubuntu using the following command: $

What does the blue screen code 0x000000d1 represent? What does the blue screen code 0x000000d1 represent? Feb 18, 2024 pm 01:35 PM

What does the 0x000000d1 blue screen code mean? In recent years, with the popularization of computers and the rapid development of the Internet, the stability and security issues of the operating system have become increasingly prominent. A common problem is blue screen errors, code 0x000000d1 is one of them. A blue screen error, or "Blue Screen of Death," is a condition that occurs when a computer experiences a severe system failure. When the system cannot recover from the error, the Windows operating system displays a blue screen with the error code on the screen. These error codes

See all articles