Python Book recommendation, python book

Source: Internet
Author: User

Python Book recommendation, python book

Python Book recommendation list:

Tip: Learn how to obtain the file name under the directory on the windows platform. (My python book location E: \ Python \ Python_book)

D: \> e:

E: \> cd Python

E: \ Python> cd Python_book

E: \ Python \ Python_book> dir/B> name.csv

E: \ Python \ Python_book>

In this case, a name.csv file is generated under E: \ Python \ python_book. its content is the file name list under the directory.

You can obtain the file name list in a similar way in linux.

[Root @ localhost ~] # Ll-rth> name.csv

Of course, you can use awk for preliminary cropping to obtain a more appropriate list of file names. (However, after saving it in CSV format, we can easily use EXCEL for further processing (separated by spaces, we can easily extract the file name list ))

After obtaining the file name list, we can batch rename it. This is the most useful. However, these can be processed through EXCEL. Of course, if you feel that the limit is not enough, you can write your own scripts for processing. Therefore, Python provides powerful text processing capabilities.

Sub-platform processing mode:

WINDOWS:

Re old_file_name new_file_name

.......

Re old_file_name new_file_name

Then, copy and paste the syntax format of the above edge of the file name to be changed to notepad and save it. the format of the file ending with bat. When we double-click the file, the names of the files we want to modify will be modified in batches.

LINUX platform:

Mv old_file_name new_file_name

.......

Mv old_file_name new_file_name

Run the sh script.

There are a lot of methods in linux. Here we will enumerate one. If combined with regular expressions, it may have unexpected results. Try the rename function, which involves regular expressions.

Related Article

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.