Python to delete files and compress folders

Example effect:After the project is compiled and published, delete some of the configuration files and then make the compressed package that publishes the files.#-*-coding:utf-8-*-ImportOs,sysImportZipFileImportDatetime,timedefGETTODAY_YYYYMMDD

Python socket module

1. Socket moduleEstablish a network communication connection with at least a pair of port numbers (sockets). Socket is the nature of the programming Interface (API), TCP/IP encapsulation, TCP/IP also to provide the interface for programmers to do

Python Unit Test Unitest

Import UnitTest class Testdict (unittest. TestCase):Reference the Unitest module, and then define a test class that inherits the Unitest. TestCase.Method test the pre-operation setupdef setUp (self): # Hook method for setting up the test fixture

Python note five (time module)

When it comes to time, we need to use the time module. Before using the module, you should first import the module.1. Common methods1)time.sleep (secs)(thread) to postpone a specified time run. Unit is seconds.2) Time.time ()Get the current

Python-raw string Suppression Escape

Tag: The raw input is the BSP window txt span string that willRaw string Suppression escapeThere are times when we need to open files and so on, then we need to enter the path, especially the window path, mostly using backslashes, this time there

Python Learning Note __2.4 recursive function

# This is a learning note for the Liaoche teacher Python tutorialinside a function, you can call other functions. If a function calls itself internally, the function is a recursive function. Write a factorial function using a recursive function:def

Python data preprocessing

I. Attribute specificationIn the process of data preprocessing, if a column of data is the same or the property is the same, then this column does not help our prediction, should be removed, pandas if a column property value is the same, but there

Summary of several methods of Selenium2+python automatic 65-JS positioning

ObjectiveThis article summarizes several JS commonly used positioning element method, and uses the JS click button, the input input box to enter the textOne, the following summarizes the 5 kinds of JS localization methodExcept that the ID is

Writing and pruning of Python files

1 #Coding=utf-82 #!/usr/bin/python3 #-*-coding:utf-8-*-4 Importio5 ImportOS6 7 8 defFile_chance ():#Modify the contents of a row within a file9f = open ('Text1','R')Tenw = open ('Text2','W') Onen =0 A forIinchF: -n + = 1 - ifn = = 3:

Python file operations

Tag: Package parameter does not require truncate type command script cannotAn introductionThe computer system is divided into three parts: the hardware, the operating system and the application.Applications that we write in Python or other languages

Python Learning log--udp socket use

UDP communication between the two sides is also divided into the client and server, but in the personal understanding of this aspect of UDP is not strictly differentiated, send the request for the client, responding to the request for the service

Python interface Automation 3-Auto Post (session)

Statements wereOn a simulation login blog park, but this is only the first step, general login, there will be other operations, such as posts, comments, etc., how to maintain the session?(Knock the blackboard!!!) Because the blog park recently login

Using the command line in Linux to pass parameters to Python

:Today in the experimental building answer to challenge, met a point has no clue to the topic, Link: https://www.shiyanlou.com/courses/running, title, because before the problem, because no contact with this type of topic, so can not start Baidu a

Python's variable declaration

Python, like most other languages, has local variables and global variables, but it does not have a distinct variable declaration. The variable is generated by first assignment and automatically dies out when it goes out of scope.Example 1. Defining

Python Learning Diary 5

One, recursive function1 #in the list L, to find one of the values, the dichotomy can greatly save the query time2l=[2,3,5,10,15,16,18,22,26,30,32,35,41,42,43,55,56,66,67,69,72,76,82,83,88]3 #If you want to find a 66 position without using index4

Python operates under Windows Ch341dll

1 #!/usr/bin/env python2 #Coding=utf-83 ImportOS4 Import Time5 fromcTYPESImport*6 7 classCH341 ():8 def __init__(self, dev = 0xb8):9SELF.DEV_ADDR =DevTen One defread (self, addr): Ach341 = Windll. LoadLibrary ("CH341DLL.dll") - ch341. Ch341

Python-day40 Sub-query

Subquery: A query statement enclosed in parentheses, as a condition of another query statement to use, become a subquery;1--subquery: A query statement enclosed in parentheses, as a condition of another query statement to use, called a

Python reads Excel

1 Importxlrd2Book = Xlrd.open_workbook ('App_student.xls')3Sheet =book.sheet_by_index (0)4 #Sheet2 = book.sheet_by_name (' shee1 ')5 #Print (Sheet.cell (0,0). Value) #指定sheet页里面行和lie获取数据6 #Print (Sheet.cell (1,0). Value) #指定sheet页里面行和lie获取数据7 #Print

Python string formatting

There are two ways to format a python string: percent-percent, format-method#%[(name)][flags][width]. [Precision]typecode# %s followed by direct add% after if S is the same as any type, D is followed by the integral typeof the gymTel ="I am%s

Python polymorphism and polymorphism

Referenced by: http://www.cnblogs.com/linhaifeng/articles/7340687.htmlPolymorphism in Python refers to a class of things that have many forms. For example, animals have many forms, people, dogs, cats, and so on.ImportABCclassAnimal (METACLASS=ABC.

Total Pages: 4013 1 .... 2136 2137 2138 2139 2140 .... 4013 Go to: GO

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.