Python programming quickly get started with tedious work automation cloud

Source: Internet
Author: User
Tags time and date

Book cover

About the book

The first part of the book introduces the basic Python programming concept, and the second part describes a number of different tasks that you can get your computer to do automatically. The second part of each chapter has some project procedures for you to learn. Here is a brief introduction to each chapter.
Part I: Basics of Python programming
The 1th: Python basics Describes the most basic types of expressions, Python directives, and how to use the Python interactive environment to try to run your code.
The 2nd Chapter: Control Flow explains how to let a program decide which instructions to execute so that the code can intelligently respond to different situations.
The 3rd Chapter: functions describes how to define your own functions so that you can organize your code into manageable parts.
The 4th Chapter: list describes the list data types and explains how to organize the data.
"The 5th Chapter: Dictionaries and structured data" describes the dictionary data types and shows a more powerful way to organize your data.
The 6th chapter: string manipulation describes the processing of text data (called Strings in Python).

Part II: Automation tasks
The 7th chapter: pattern matching and regular expressions describes how Python handles strings with regular expressions and finds text patterns.
"The 8th chapter: Read and Write Files" explains how the program reads the contents of a text file and saves the information to a file on the hard disk.
The 9th chapter: organizing files shows how Python can copy, move, rename, and delete a large number of files, as well as compress and decompress files, with much faster speeds than manual operations.
The 10th chapter: Debugging shows how to use Python's flaw-finding and bug-fixing tools.
"The 11th chapter: crawling Information from the Web" shows how to program to automatically download pages, parse them, and get information. This is called crawling information from the WEB.
"The 12th chapter: working with Excel spreadsheets" describes programming Excel spreadsheets so you don't have to read them. This is helpful if you have to analyze hundreds or thousands of documents.
"The 13th chapter: Working with PDFs and Word documents" describes the programmatic reading of Word and PDF documents.
"The 14th chapter: working with CSV files and JSON data" explains how to programmatically manipulate CSV and JSON files.
The 15th chapter: Hold time, Scheduled tasks, and startup programs explains how the Python program handles time and date, and how to schedule a computer to perform tasks at a specific time. This chapter also shows how a python program starts a non-Python program.
"The 16th chapter: sending e-mails and text messages" explains how to program to send e-mails and text messages.
The 17th chapter: Manipulating images explains how to program images such as JPG or PNG.
"The 18th Chapter: using GUI Automation to control the keyboard and mouse" explains how to programmatically control the mouse and keyboard, automate mouse clicks and keystrokes.

Images

Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From collectionsImport Counter
From ZhonImport Hanzi
Import string
Import re
Import OS
Import Matplotlib.pyplotAs Plt
Import Jieba
From WordcloudImport Wordcloud, Imagecolorgenerator

With open (' Python programming quickly get started with. txt ',' R ', encoding=' Utf-8 ')As FP:
Alltext =". Join (Fp.readlines ())

Alltext = Re.sub ("[%s]+"% hanzi.punctuation,"", Alltext)
Alltext = Re.sub ("[%s]+"% string.punctuation,"", Alltext)

Seg_list = Jieba.cut (Alltext, cut_all=False)
Seg_list = List (seg_list)

Counter = Counter (seg_list)
top = Counter.most_common (1000)

Top_dict = Dict (top)

Stopwords_list = []
PWD = Os.path.abspath (‘.‘)
For fileIn Os.listdir (Os.path.join (PWD,' Stopwords ')):
filename = Os.path.join (pwd,' Stopwords ', file)
with open (filename,' R ')As FP:
Stopwords_list.extend (Fp.readlines ())

Stopwords_list = List (set (Stopwords_list))

For Stopword in stopwords_list:
try:
Top_dict.pop (Stopword.strip ())
except:
pass

WC = Wordcloud (background_color= 50,
random_state= 42)

wc.generate_from_frequencies (top_dict)

plt.imshow (WC)
plt.axis ( ' off ')
plt.show ()

Python programming quickly get started with tedious work automation cloud images

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.