1) Os.path
1.1 Os.path.isabs (path) is an absolute path
1.2 Os.path.isfile (PATH)
1.3 Os.path.isdir (PATH)
Whether the 1.4 Os.path.islink (path) is a link, but returns false if the system does not support linking
1.5 Os.path.ismount (path) is a
For Python-based Web projects, common deployment methods are:
FCGI: Generate a listener process for each project, and then interact with the HTTP service, using a spawn-fcgi or framework-led tool.
WSGI: Use the HTTP Service's MOD_WSGI
Objective
ROC (Receiver operating characteristic) curves and AUC are often used to evaluate the merits of a binary classifier (binary classifier). This article will first briefly introduce ROC and AUC, and then illustrate how Python makes the ROC
Python
Copy Code code as follows:
DEF fn (num):
'''
Turn the numbers into colloquial
'''
ret = '
num = int (num)
If num/10000 = 0:
ret = str (num)
Else
If num/10**8 = 0:
If num%10000!= 0:
ret = str (num/10000) + ' million '
Recently because of the frequent use of Excel, you need to follow the contents of the Excel table for some apk processing, manual processing is cumbersome, and decided to write a script to deal with. First post a script that reads and writes Excel
Parse pathpath resolution relies on some of the variables defined in the OS:
os.sep-the separator between the parts of the path.
os.extsep-the delimiter between the filename and the file name extension.
The os.pardir-path represents a
When a subclass needs to invoke a method of the parent class, the method of the class is invoked directly with the class name before the python2.2, that is, the unbound class method, and the Self object self as an argument is passed in.
1. When the shell script executes the Python script, you need to use the return value of the Python script to determine the command to be executed by the following program
Example: There are two py programs hello.py
Copy Code code as follows:
Copy Code code as follows:
Import PDB
def pdb_test (ARG):
For I in range (ARG):
Print (i)
return arg
Pdb.run ("Pdb_test (3)")
b function name, line number:
Break point, B can query all breakpoints.
Copy Code
Copy Code code as follows:
#!/usr/bin/python
#coding: Utf-8
#write: JACK
#info: FTP Example
Import ftplib, socket, OS
From time to import sleep, CTime
def loginftp (self):FTPs = Ftplib. FTP ()Ftps.connect
Development environment: Python version 2. X
Copy Code code as follows:
#!/usr/bin/env python
#-*-Coding:utf-8-*-
# for Python version: 2.X
Import sys, Urllib, reImport Oauth.oauth as OAuthFrom URLLIB2 import Request, Urlopen
is a simple python query Baidu keyword ranking function, here are some brief introduction:1, UA Random2, simple and convenient operation, direct GetRank (key words, domain name) can be3, code conversion. There should be no problem with coding.4, the
A text file with the following format
Copy Code code as follows:
/"/Please/!" /"/"/Please/! /"/Two/sword/individual/reverse/sword tip/,/right hand/grip/hilt/,
/left hand/put on/right hand//,/bowed bow salute/. /two/person/body/not
Doing WEB development involves dealing with the template engine. I have also been exposed to a number of Python template engine, the feeling can be summed up.
First, according to my degree of familiarity to list:Pytenjin: I used it when I was
1. What is NumPy
Very simply, NumPy is a scientific computing library of Python that provides the function of matrix operations, which are commonly used with scipy and matplotlib. In fact, the list already provides a representation similar to a
Module-level functions
Logging.getlogger ([name]): Returns a Logger object that returns root if no name is specified loggerLogging.debug (), Logging.info (), logging.warning (), Logging.error (), logging.critical (): Setting the log level of root
Touch python time is not very long, recently a project needs to analyze data, and then choose Python as the programming language, in addition to language features, mainly focus on Python for SQLite3 database good support capabilities, because the
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