You can use the python package to create a simple web server. In dos, CD to the path to prepare the root directory of the server. Enter the following command:
Python-mWeb Server Module[Port number, 8000 by default]
For example:
Python-M
1. Windows 7:
Install python2.x or 3.x,Programming LanguageNote that most of the tutorials on the Internet are 2. x.
After cmd, before running Python XXX. py, you need to set the environment variable and write the path name during Python
the problems encountered in the project are recorded as follows to be useful to others.
def valid_xml_char_ordinal (c ): "" @ summary: check if the char is a valid XML character @ Param C: the character to be checked @ see: #
According to the Chinese lunar calendar, this year is the year of the snake, or the year of the birth of Python. Python as a lightweight WebProgramming LanguageProgramming people have been paying more and more attention in recent years. The four
1. Deep linked list
First, we will introduce some common methods for linked lists:
Append (x): adds an element to the end of the linked list.
Extend (l): merges another linked list into this linked list.
Insert (I, X): insert an element
1. Go to the \ opencv \ Interfaces \ swig \ Python directory and run
Install Python setup-for-win.py
Install
2. After the installation is successful, you will find that the directory opencv is added under python26 \ Lib \ Site-packages, which should
#!/usr/bin/python# Filename: inherit.py
class SchoolMember: '''Represents any school member.''' def __init__(self, name, age): self.name = name self.age = age print'(Initialized SchoolMember: %s)'% self.name
def
Python has complete support for sockets. some of the APIS though have a different signature than the POSIX equivalents. it is therefore possible to write multicast servers and clients in Python. multicasting is the ability to send data to select set
For today's WebService development, we have at least two options: SOAP/WSDL/UDDI series; rest-style architecture series !!!
In the field of bioinformatics (bioinformatics), WebService is an important data exchange technology and will be more
The definition of object methods in python is very strange. The first parameter is generally named self (equivalent to this in other languages), used to pass the object itself, when a call is made, it does not need to be explicitly transmitted, and
Document directory
What is a PyC file?
What is a Pyo file?
What is a PYD file?
Why is the PyC file required?
Generate a single PyC File
Generate PyC files in batches
Summary
It's actually very simple,UsePython-M py_compile file. py
Python-
Since the _ strptime method in datetime and time in Python does not support multithreading, an error is reported during running:
Import datetimeImport threadImport time
Def F ():Datetime. datetime. strptime ("20100101", "% Y % m % d ")
For _ in
Reorganize the old test code. In the application scenario, there was a previous test code without unittest, which was run through another packaging file and rarely used in daily life.
Retooling old test code to run inside unittest.
Sometimes, we may
File Operations in the OS module:OS module attributesLinesep is a string used to split rows in a file.A string used to separate the file path name.Pathsep is a string used to separate file paths.String name of the current working directory of
Recently, we need to export the site address of the Google search results. Then, the regular expression in python is used to extract the search results.
This involves several issues to be solved:
1. Obtain the search result text
To get more
The logging Module Interface of python is similar to log4j. It is similar in concept and convenient to use. Logging. config. fileconfig () can be used to describe the log configuration in a file, which simplifies log initialization.
Routine:
#
1 callable built-in functions determine whether a name is a callable Function
>>> import math>>> x = 1>>> y = math.sqrt>>> callable(x)False>>> callable(y)True
2 record function (document string)
>>> def square(x): 'calculates the square of number
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