into a directory. Then enter the directory in the terminal, entering the Python configure.py--platform linux-g++;make;make install in turn.A function written in C + + is used in Python.1, first, write a C file , the function is to add two numbers and output, named ADD.C, this will become the module name in Python, as
I created a freeswitch kernel research and exchange group,45211986. welcome to join us. In addition, we accept the SIP-based communication server and client solutions.
Freeswitch supports cross-platform, and the underlying library uses Apache Portable Runtime lib (APR). The author has been familiar with Apache in his previous work.In swith_apr.c, all the tool library interface functions provided by APR are referenced by freeswitch for the purpose
Simple Solution: c: \ Python26 \ python.exe setup. py py2exe -- extends des sip
It is very convenient to use pyqt to complete the form interface, but there will be problems after packaging it into exe. The solution on the internet is as follows:Another Solution to the same problem:
from distutils.core import setupimport py2exesetup(windows=[{"script":"main.py"}], options={"py2exe":{"includes":["sip"]}})
SIP is a tool for generating C + + interface code for Python, similar to SWIG, but using a different interface format. The idea originated in Swig, primarily to create the QT package for Python, which was used to create PyQt and Pykde , and to support the QT Signal/slot system. This article mainly introduces the compilation and installation of
using tools:Although the extension process is not complex, you can use many known tools to simplify the scaling process.(1) SWIGCreated by David Beazley, is an automatic extension construction tool. It reads in the commented C + + header file and generates wrap code for a variety of scripting languages, such as Python, Tcl, and Perl. Swig can wrap a lot of C + + features into Python's extension modules. Please refer to http://www.swig.org for details
, has been completely attracted by WxPython , can not wait to practice, hereby record the individual learning process (Windows system):First, Wxpython environment installationThe most realistic and practical way to install Pip, and must be used in a manner that will synchronize the installation of dependent packages: pip install-u wxPythonsecond, Wxpython tastedAs a beginner, must not blindly directly into the subject, it is necessary to go through this stage, can be very good to help understand
Time module of python module, time module of python ModuleTime
Three Forms of time
Timestamp: Generally, the timestamp indicates the offset calculated in seconds from 00:00:00, January 1, January 1, 1970. We run "type (time. time ()" and return the float type.
Fo
format, same as Time.strftime ()Stream: Specifies the output stream that will log, can specify output to Sys.stderr,sys.stdout or file, default output to Sys.stderr, stream is ignored when stream and filename are specified simultaneouslyLogging.getlogger ([name]): Create a Log object:Returns a logger instance that returns root logger if no name is specified. As long as name is the same, the returned logger instances are the same and only one, that is, the name and the logger instance are one by
Sys module and serialization module (instance description) of the python module, and python serialization
Sys module
The sys module is an interface for interacting with the
one, sys module1. Definition:A module that interacts with the Python interpreter2, sys module commonly used methods(1) sys.argv methodDefinition: Command line Arguments list, the first element is the path of the program itselfCases:Import Sysprint (SYS.ARGV) # SYS.ARGV just reflects the current module name, with a list
Python module and package, python Module
1. The. py file can be viewed as a module, which is similar to the class library encapsulated in other languages.
Module category:Built-in modulesCustom ModuleThird-party
Python: sequence and module; python: sequence Module
I. serialization Module
What is serialization? the process of converting the original dictionary, list, and other content into a string is calledSerialization.
For example, if a piece of data we compute in
(), logger.warning (), Logger.error (), logger.critical () output different levels of logging, Only logs with log levels greater than or equal to the set log level will be output.
Only the output
2014-05-06 12:54:43,222 - root - WARNING - logger warning message2014-05-06 12:54:43,223 - root - ERROR - logger error message2014-05-06 12:54:43,224 - root - CRITICAL - logger critical message
From this output you can see that logger = Logging.getlogger () returns the logg
Configparse module is used to generate and modify, parse (read analysis, get data) Common configuration documents, most of such configuration file name format is Xxx.ini, for example, MySQL configuration files.The name of the current module is changed to Configparser in the Python 3.x version. (Python2 initial capital letter)configuration File Sample Description
Python BASICS (12)-module, python basics-Module
URL: http://www.cnblogs.com/archimedes/p/python-modules.html.Module Introduction
If you exit the Python interpreter and re-enter, all previously created definitions (variables and fu
JSON module
There was an eval function that could extract a corresponding data type from a string, such as "{" "Name": "Zhangsan"} "to extract a dictionary." JSON modules can do the same thing, but more powerful, Eval can only recognize the data structure of the Python language. JSON can recognize multi-language data structures
Import of modulesImport JSON
Encapsulates a data type in JSON
One, OS module 1 os.getcwd () Gets the current working directory, that is, the directory path of the current Python script work 2 3 os.chdir ("dirname") changes the working directory of the current script; equivalent to the Shell CD 4 5 Os.curdir returns the current directory: ('. ') ) 6 7 Os.pardir Gets the current directory string name: (' ... ') 8 9 os.makedirs (' dirname1/dirname2
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.