Building and running of Python Web simple server
Python 3 server Building is configured with environment variables, in DOS CD to the project directory, input: python-m http.server--cgi 8080
The following are the problems and solutions I have
The small demo is like this:
Flag = True
if Flag:
print ("I am true")
else:
print ("I am false")
This will burst into a: "Non-ascii character ' \xe6 ' in file" error, but if I change the code to the following:
Flag = True
if Flag:
Data is collected with ' <> ' HTML tags: Research The earliest and A teaching as one of the modernization of Comprehensive Division from the Sex Provincial hospital here as long as all band <> removal can be: Dr = Re.compile (R ' ]+> ', re.
Recently read "Simple design mode" This book, a lot of harvest, is going to write a series of blog, and Python to achieve each of the design patterns to deepen understanding.
Here is the first design pattern in the book: strategy mode
In the book to
1, Export function Example
#include #include using namespace std;
int add (int arg1, int arg2) {return arg1 + arg2;}
int sub (int arg1, int arg2) {return arg1-arg2;}
Static pyobject* Math_add (pyobject* self, pyobject* args) {int arg1, arg2;
http://zc0604.iteye.com/blog/1520703
Http://www.cnblogs.com/rirtue/archive/2012/01/12/2321028.html
http://blog.csdn.net/zgx007/article/details/61072261,xml Document Structure 1.1,xml document includes XML header information and XML information body
Because recently do Buildbot, want to use the company's mail system Lotus Notes to send mail, but there are no more complete examples on the Internet, are more examples of VB, or incomplete examples, and then see a Visual FoxPro to do the example,
Original address: http://www.cnblogs.com/way_testlife/archive/2011/04/20/2022997.html
--------------
Image module in PIL
This article is an excerpt from PIL Handbook online and has done some simple translations
can only ensure that they understand,
First Respect Original: http://blog.justbilt.com/2014/07/02/setup_python_on_mac/
build a Python environment on a Mac
This two days to recreate the environment of Python, found that many places are still easy to forget, so have this article, later
Why do I have to write this script, because recently bought the house is Vanke's hardcover room, there are owners to take some photos, for everyone to enjoy the following:
Therefore, the local BBS, brush reading volume, so that the
Online collection of 2 ways:
A:
Similar to:
\u3232\u6674
String, converted to the corresponding Unicode character.
"Resolution Process"
The corresponding, can be decoded through the Python decode function, where the original string bit
Chapter Nineth Analysis of text data and social media
1 Installation NLTK slightly
2 Filter Stop word name and number
The sample code is as follows:
ImportNLTK # Load English stop word corpus SW = set (Nltk.corpus.stopwords.words (' 中文版 '))
I. Class bodyA class body generally consists of two parts:Variable part, also called static variable, static field.Method (function) section.classPerson :#"Body: two parts: Variable part, method (function) part" "Mind ='have thought' #variables,
1) class contains:Properties of the class: variables involved in the classMethod of class: Function in class2)_init_ function (method)1. First of all, a function with two underscores begins with declaring that the property is private and cannot be
List of lists:1 #Li = [one, one, one, one, and one]2 #Parameters3 #1. The original value was last appended4 #object. Method (..) # Li Object calls the Append method5 #li.append (5)6 #Li.append ("Alex")7 #li.append ([1234,2323])8 #Print (LI)9 #2
Look at the python test these days, based on the function method and class-based testing, the main module used is the UnitTest module, for the specific methods and classes, set up a test module, test function function to meet the expectations. Here
Python supports relative import syntax, which can be imported relative to a package, with the following syntax:# import "./dir2/spam.py",. Represents the current directory from Import spam # import "./.. /dir3/spam.py ",. Represents the current
Importmatplotlib fromPandasImportDataFrameImportNumPy as NPImportPandas as PDImportMySQLdbImportMatplotlib.pyplot as Plt#DF =padaas Dataframe Object (two-dimensional tag array)#S =pandas Series object (one-dimensional tag array)db = MySQLdb.connect (
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