ArticleDirectory
Update version 1.1
I. Functions
Ii. Example
Iii. Download
Update version 1.1
Right-click menu
Download the latest version 1.1 source code and executable programs
--- Introduction to version 1.0 ---I.
1. Read the file content
Filepath = "file path" (lambda F: (F. Read (), F. Close () (file (filepath) [0] 2. Write the content to the file
(Lambda F, D: (F. write (D), F. close () (file (r 'd:/a.txt ', 'w'), 'Data to be written ') 3. Filter files
Alas ~ Today, I spent an afternoon comparing static methods and class methods in Python. Finally, I had to spend a long time in the official document. Finally, I realized the differences between the two functions. Alas ~ Why is it so tangled ~ It
Help is a built-in function. The so-called built-in function is a function automatically loaded in Python and can be used at any time. There are two types of parameters:
If a string is passed as a parameter, it will automatically search for
I wonder why Python does not provide access control like C ++ and Java and cannot control the visibility of functions and classes defined in the module; the function and variable defined in the class can be identified by a prefix of no less than two
1. String or byte string?
In my opinion, a python string can only be a byte string. You can even store an image or a binary executable file in it.
Import typesF = open ('d: // hello.jpg ', 'R ')PIC = f. Read ()Print type (PIC) = types.
The function for formatting the date and time in python isDatetime. datetime.Strftime ();The functions converted from string to date type are:Datetime. datetime. strptime (),Both functions involve formatted strings of date and time, which are listed
(Www.darkbull.net)
Today, we plan to integrate python into the project as a scripting language, mainly used to process string and Network Interactions (such as sending emails and submitting HTTP requests ). The boost. Python component provides very
In the python standard module, multiple modules are used for data compression and decompression, such as zipfile, Gzip, and bz2. I introduced the zipfile module last time. Today I will talk about the zlib module.Zlib. Compress (string [, level])
Run the following code:
#! /Usr/bin/ENV PythonS = "Chinese"Print s
This problem has been frequently encountered recently:
Problem 1: syntaxerror: Non-ASCII character '\ xe4' in file E: \ coding \ Python \ untitled 6.py on line 3, but no encoding
Python loop log
Refer:
Http://docs.python.org/2/library/logging.html
Rotatingfilehandler is used to process cyclic logs. You can specify the log file level, maximum log file capacity (in bytes), and log files.
#!/usr/bin/python# filename:
1. Problem description: a Scheduled Update Project written in Python under the Django framework, which is tested in windows and tested in Linux, reports the following error:
ASCII codec can't decode byte 0xe8 in position 0: ordinal not in range (128
Introduction:
# Coding = UTF-8 ''' Note: Socket originated from the Unix of the University of California at Berkeley in the 20th century, which is what we often call bsdunix. Sometimes it is also called "BSD socket ". At the beginning, it was
The previous article mentioned the length of Chinese characters. This article mainly tests this point and the code is as follows:
#! /Usr/bin/python #-*-coding: UTF-8-*- S = "China" SS = u "China" Print S, type (s), Len (s) Print SS, type (SS),
Introduction
Guess the output of the following code:
class A(object): def __init__(self): self.__private() self.public() def __private(self): print 'A.__private()' def public(self):
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