[Python] [tips] [No. 2] Python string cross-row connection, or split into multiple rows for display, pythonno.2

Source: Internet
Author: User

[Python] [tips] [No. 2] Python string cross-row connection, or split into multiple rows for display, pythonno.2
1. Preface

It is a large string that is directly connected to a small string in a long format.

So we split it into multiple lines, that is, aesthetic, and easy to modify.

For example, the wildcard character in the file selection box:

Wildcard = "Python source code file (*. py) | *. py | Python compiling file (*. pyc) | *. pyc | text file (*. txt) | *. txt table file (*. xlsx) | *. xlsxEgg file (*. egg) | *. egg | All files (*. *) | *. *"

The viewing and modification are inconvenient.

2. Method 1: Use a line break

In addition to the last line of strings, add \ To the end to continue the line.

PS. If you are not clear about the meaning of the character string prefix with a letter, go to [1] in [tips] of this blog.

2. Write in the () Expression

This method looks better and feels good to use ~~

3. Postscript

Reprinted please indicate the source (● 'authorization' ●): http://www.cnblogs.com/Twobox/

14:52:30

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.