This series does not give a detailed description of the Python syntax and theory, so it is not a learning material; A detailed study of the Vamei; is a good (basic-intermediate-Advanced) Learning tutorial. And here is just a summary of some of the
Transfer from Http://stackoverflow.com/questions/3652625/installing-setuptools-on-64-bit-windows Problem I ' m running Python 2.7 on Windows 7 64-bit, and if I run the installer for Setuptools it tells me, Python 2.7 are not installed. The specific
Content directory:
Object-oriented application scenarios
Creation of classes and objects
__init__ construction method in a class
Self understanding
Three main features of object-oriented: encapsulation, inheritance,
Do not have universality, stay as a souvenir.[[email protected] python]#Cat insert_pv.py#!/usr/bin/env python#-*-coding:utf-8-*- fromDatetimeImport* fromwith_conn_to_dbImportConn_to_mysqlImportUrllib2,jsonImport Time## #define Yestoday 0-24 hours
An adorner is essentially a function that handles other functions that allow additional functions to be added without the need to modify the code, and the return value of the adorner is also a function object. It is often used in scenarios where
Use Python to get a list of machine-installed programs by reading the registry, including, software name, version number, installation date, etc.#-*-Coding:utf8-*-Import _winregImport OSImport Commmethod1."Get the list of programs under
Recently, I want to complete an automated framework that uses Excel tables to manage test cases, so I re-learned the next xlrd, using this module to read data from Excel tables.First, install the XLRDDownload http://pypi.python.org/pypi/xlrd on the
Read machine process information via Psutil module:#-*-Coding:utf-8-*-Import Psutil;Import OSImport Commmethod"Get information about the machine's current process"Def getcurrentprocessinfo ():lst1= Psutil.pids ()Lst1.sort ()For I in Lst1:temp =
Topic linkshttps://leetcode.com/problems/add-binary/Original title
Given binary strings, return their sum (also a binary string).
For example,A = "11"b = "1"Return "100".
Topic translationGiven two binary strings, returns their and
(1) Variables and assignments
Name = "Wanghuafeng"Age = 29Print (name, age)
A and B exchange values
A = 3b = 5TMP = aA = bb = tmpPrint (A, B)
(2) Character encoding ASCII code table (2**8=128 characters) Unicode:
# Encoding:utf-8Number = 69guess = Int (input (' Please enter an integer: '))# print (' You guessed the number is: ' +str (guess) ')If guess = = number:Print (' Congratulations, you guessed right ')# Elif Guess # print (' Sorry, the result is bigger
Topic linkshttps://leetcode.com/problems/binary-tree-paths/Original title
Given a binary tree, return all root-to-leaf paths.
For example, given the following binary tree:
1 / 2 5
All root-to-leaf paths is:["1->2
a python stringIt's mainly Python's more special place.
There is no difference between "and", when nesting, they need to be used to make a difference.
To prevent the \ Post character from being treated as an escape character, add R to
enter Python directly in the terminal, enter Python,python-v view version, quit (); exit (); ctrl+d, exit PythonNote: Python requires strict indentation because its program code does not have a trailing sign and is judged by indentation. Official
Common list built-in methods :Append ()Append data to the list, append the data to the last side of the list>>> name_list=[' Zhangsan ', ' Lisi ', ' Wangwu ']>>> name_list.append (' Liumazi ') >>> name_list [' Zhangsan ', ' Lisi ', ' Wangwu ', '
1 Running a python program under Windows1) Run the Python script from the DOS command lineUsing Python interpreter to execute Python script, under Windows Python interpreter is python.exe, my Python file is installed in D:\Python27, in this
1. What is the. pyc file for PythonThe . pyc file in Python refers to a file of this type with a suffix of. PYc, in our Python installation directory, the directory where the module is located Lib will see a lot of module files that end in. py. The
In Pythonfrom Pandas import Dataframe,seriesimport pandas as Pdimport numpy as Npdata = Pd.read_csv (R ' C:\Users\lxy\Desktop \ work related \ Work Report kpi\pydata-book-master\ch06\ex5.csv ') data.index.name= ' x ' data.to_csv (' D:\df.csv ') in R>
[Python] set learning and pythonset Learning
Similar to other languages, python set is a disordered, non-repeating element set. Its basic functions include link testing and deduplication. the Set object also supports mathematical operations such as
Python deep copy and shallow copy, pythonshallow
In Python, object assignments are referenced, rather than copying objects (Assignment statements in Python do not copy objects, they create bindings between a target and an object .). For a mutable
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