In DOS CD to prepare to do the server root directory under the path, enter the command:
PYTHON-M Web server module [port number, default 8000]
For example:
Python-m simplehttpserver 8080
Then you can enter it in the browser
One, multi-processLinux Platform Examples:unix/linux operating system provides a fork () system call, which is very special. A normal function call, called once, is returned once, but fork () is called once, returning two times, because the
This article is all from my (wheat) "Big Data Public" course handout, including three Python and numpy data analysis package related tutorials, Excel and SPSS data Analysis tutorial, etc., the author is wheat and Yi Wen classmate, is the original
Python Coding Summary:1). First Python has two forms of string, str and Unicode, where Unicode is equivalent to bytecode, which can be used across platforms.Str converted to Unicode can be u,str.decode in three ways by Unicode ()Unicode is converted
def levltwo (levlonelist,levlonenum): "" " entry levlonelist first-level city list entry Levlonenum user selected city serial number The Levltwolist returns a level two city list "" " if Int (levlonenum) Function "" ".... "" "does not
# coding=utf-8 ' Created on June 15, 2014 @author:yang ' import socketimport datetime# Initialize sockets = Socket.socket () # Get host name, can also use localhost# host = Socket.gethostname () host = "localhost" # Default HTTP protocol port number
Python basics How to get a program to receive parameters, the simplest to use sys.argv[] to get1. UsageImport SYS #导入sys模块Sys.argv[tag] #根据参数的下标来取值Where tag is the subscript value, where the program itself is 0,sys.argv[0]2. For example(test_3.4.2) [
1. to add a new element ( object ) at the end of the listL.append (object)--Append object to end>>>l = [' Sam ', ' Shaw ', ' Stiven ']>>>l[' Sam ', ' Shaw ', ' Stiven ']>>>l.append (' Alice ')>>>l[' Sam ', ' Shaw ', ' Stiven ', ' Alice ']2. used to
Collection : Used to contain a set of unordered objects ;It can be understood that putting a list in {} makes up a collectionCreate a collection : Use the Set function or use {} and provide the item to be stored, such as:s = set ([3,5,9,10])
Linked list operations can only be traversed once and then.With a double pointer# Definition for singly-linked list.# class ListNode (object): # def __init__ (self, x): # self.val = x# Self.next = Noneclass Solution (object):
1. The first is a very boring function that implements the two number of addition operations:def f (x, y ): print x+YF (2,3)Output also OK52. But at this point we feel that the output is too singular, to make the output of the code look less
Parameters of the function
When defining a function, we determine the name and position of the parameter, and the interface definition of the function is completed.Python's functions, in addition to the normal definition of required parameters,
One. Time moduleTime module provides functions for various operating timesThere are generally two ways to represent time:The first is the way the timestamp is (relative to the offset from 1970.1.1 00:00:00 in seconds), the timestamp is
Why is multi-process rather than multi-thread recommended in python? -- Transfer an article from a colleague
I have been reading multiple threads in Python recently. We often hear veterans say, "multithreading in python is a weakness. We recommend
Mysql Data Type
1. Integer
MySQL Data Type
Meaning (Signed)
Tinyint (m)
1 byte range (-128 ~ 127)
Smallint (m)
2 bytes range (-32768 ~ 32767)
Mediumint (m)
3 bytes range (-8388608 ~ 8388607)
Python-object-oriented (1)-Basics of opening, python-IntroductionObject-Oriented Programming (Object Oriented Programming, OOP, Object-Oriented Programming)
I. Create classes and objects
Object-Oriented programming is a programming method, which
Python GUI learning-Tkinter, pythonguitkinter
Common python GUI toolkit:Tkinter uses the Tk platform to easily obtain the semi-standard.Wxpython is based on wxWindows. Cross-platformPython Win can only use the Windows GUI function on Windows.Java
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