Conversion of string internal code is a common problem during development.In Java, We can first call getbyte () for a string to generate a new string for transcoding, or use charset In the NIO package.In python, you can call the decode and encode
ArticleDirectory
Self = Java's this
Why use python? The development efficiency is high and can be transplanted.
Syntax:
String:
1,Use single quotation marks (') = use double quotation marks (") = Java double quotation marks (
Python special Syntax: filter, MAP, reduce, Lambda (from "Play with Python ")
Python has built-in interesting but useful functions that fully reflect the charm of Python! Filter (function, sequence ):Execute function (item) in sequence
In python, there is a special symbol "*", which can be used as a multiplication operator for numerical operations. It is also used as a repetition operator for objects.
Note: * repeated objects have the same ID, that is, pointing to the same
Python exceptionIt is an important method for handling exceptions in Python. It has several writing methods. You can choose different methods based on the current situation. I will explain the writing method and processing method of Python exception
If you want to use python as the download tool, you need to master some network and data processing modules.
1 Network: urllib, urllib2, httplib.2. If you need to capture data for a long time, you also need to master formatting, multithreading,
When you open a. py fileCodeAt the bottom of the page, we can see if _ name _ = '_ main _':. Now let's introduce its role.
A module is an object, and all modules have a built-in attribute _ name __. The value of _ name _ of a module depends on how
PythoN is a widely used and widely used language. It has attracted countless developers. I have been using python for more than a month and have been familiar with many Python plug-ins.Article, Only record.The first one is aboutChardet.ChardetTo
From: http://hi.baidu.com/%C1%EE%BA%FC%CF%F3/blog/item/efb76fb7f0411dc437d3ca20.html In this article, we will explain all the problems with 'har' as an example. The various encodings of 'har' are as follows: 2. Unicode (UTF8-16), c854; 2.
Previously UsedBashImplemented (Http://www.cnblogs.com/MikeZhang/archive/2012/08/22/linesCountBash20120822.html), But that cannot beWindowsSo I wrotePythonIt is also convenient for me to use later ......I don't know much about it here.Google.
[Edit this section]
Python resources:
Official homepage: http://www.python.org/
For Windows Python interpreter (including tkintergui development environment, a simple IDE, complete Extensive English documentation) 9 MB:
Python-string-Function
Case-insensitive conversion of characters in a string:
* S. Lower () # lower case
* S. Upper () # uppercase
* S. swapcase () # case-insensitive swap
* S. capitalize () # uppercase letters
* String. capwords (s)
Htmlparser is a python module that is easy to use and can easily analyze HTML files.This article briefly introduces the usage of htmlparser.
During use, you need to define a class inherited from the class htmlparser. Redefinition function:
As long as object-oriented is involved, "class" is a synonym that must appear.
Class and object are two main aspects of object-oriented programming.ClassCreate a new type, whileThe object isInstance of this class.
Class concepts:
Including the
Python 3 provides the URL opening module urllib. Request and HTML parsing module html. parser. However, the HTML. parser module has simple functions and is difficult to meet the needs of parsing webpage content. Beautiful Soup 4 is a powerful Python
Author: vamei Source: http://www.cnblogs.com/vamei welcome reprint, please also keep this statement.
PythonAll objectsBut at the same time, python is also a multi-paradigm language. You can not only write it in an object-oriented
Tnlog. py
# ! /Usr/bin/ENV Python # -*-Coding: UTF-8 -*- Import OS Import Sys Import Time Import Logging Import Inspect ''' Import inspectdef test (): A = inspect. stack () [1] print a To Get A tuples, such as: (, 'test. PY ', 10,
Some software interfaces use Win32 windows to nest an IE control. With spy ++, only one Internet assumer_server control can be identified. Several common API functions cannot obtain the content in the IE control, and cannot operate the control in
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