I,Introduction
Py2exe has been used to create wxPython, Tkinter, Pmw, PyGTK, pygame, win32com client and server, and other independent programs. Py2exe is released under the open source license.
II,Install py2exe
Slave.
III,Py2exe usage
If you have
1. semi-open socket
Use the shutdown () function to convert two-way socket data transmission to one-way data transmission. Shutdown () requires a separate parameter, which indicates how to close the socket. Specifically: 0 indicates that future
The static method of C ++ uses the static keyword, and python j does not use static.
Static methods and class methods in python depend on python modifiers.
Class MyClass:
Def method (self ):
Print ("method ")
@ Staticmethod
Def staticMethod
1. First look at what is an iterable object
Take the built-in max function as an example to view its doc:Copy codeThe Code is as follows:>>> Print max. _ doc __Max (iterable [, key = func])-> valueMax (a, B, c,... [, key = func])-> value
With a
SMTP ModuleAmong so many defined classes, we usually use the smtplib. SMTP class. Let's take a look at the usage of this class:An smtp instance encapsulates an smtp connection, which supports all SMTP and ESMTP operation commands. If the host and
It took two weeks to read Tornado source code intermittently and write the series of topics "Tornado source code parsing. As the data is relatively scattered, here is a simple index and guidance.
Why the Tornado framework? Let me tell you a little
Python Study Notes (2)
Process Control
If... else... elif
Example:
If 1> 2:
Print 'aaa'
-------------------------------
If 1> 2:
Print 'aaa'
Else:
Print 'bbbbbb'
----------------------
Asynchronous callback is required in many scenarios to avoid blocking. This is a simple example for your reference.Copy codeThe Code is as follows:#! /Usr/bin/env python#-*-Coding: UTF-8 -*-Import loggingImport queueImport threadingDef func_a (a, B )
Multiple timers are implemented in a single thread.
NewTimer. pyCopy codeThe Code is as follows:#! /Usr/bin/env python
From heapq import *From threading import TimerImport threadingImport uuidImport timeImport datetimeImport sysImport math
Global
I recently learned Python and Django and want to deploy a server on my own.
Environment: ubuntu12.04 server | apache2 | django1.6 | python2.7 | mod_wsgi
Finding a lot of references on the Internet does not work, either the old version or the method
1. Use the windows attrib command to obtain the file hiding attributeCopy codeThe Code is as follows: SyntaxATTRIB [+ attribute |-attribute] [pathname] [/S [/D]
Key+: Turn an attribute ON-: Clear an attribute OFF
Pathname: Drive and/or filename e.g.
I. Classes and Instances
Classes and instances are associated with each other: classes are the definition of objects, while instances are "real objects ". The following example shows how to create a class:
>>> class MyNewObjectType(bases):...
Base:
Created Monday 17 march2014
What is crawler?
Wiki explanation: http://en.wikipedia.org/wiki/Web_spider
By referencing the interpretation on WIKI, crawlers say that a program (nonsense...) is the first one. What can this program do? He can
Copy codeThe Code is as follows:# Coding = UTF-8_ Auther _ = 'xianbao'Import sqlite3# Open a databaseDef opendata ():Conn = sqlite3.connect ("mydb. db ")Cur = conn.exe cute ("" create table if not exists tianjia (Id integer primary key autoincrement,
Save it as a. py file and run the script to add the process name after it. For example, python proinfo. py qq can obtain the process information of QQ. Note that it is case insensitive.Copy codeThe Code is as follows: #-*-encoding: UTF-8 -*-Import
1. chr (I)The chr () function returns the string corresponding to the ASCII code.Copy codeCode: >>> print chr (65)A>>> Print chr (66)>>> Print chr (65) + chr (66)AB2. complex (real [, imaginary])The complex () function converts a string or number to
Python pass is an empty statement, and the pass statement does not do anything. It is generally used as a placeholder or creates a placeholder program to maintain the integrity of the program structure. The pass statement does not perform any
Source allows the script to be executed in the current shell instead of generating a sub-shell. ByExec also allows the script to run on the same itinerary, but the original itinerary is ended.
Source./my. scriptOr: ../my. scriptIn short: whether
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