Problem: centos6.5 installed a anaconda and Anaconda3 two versions, these two versions of the Python version is not the same, one is python2.7.10, one is python3.5.2
So how do you make the environment default to python2.7.10?
Upon review, we found
VSFTPD run in the ubuntu,ftp root directory for /home/ftpdir, the root directory has a folder get, program run FTP.CWD (' Get ') Error: Failed to change Directory
Workaround:
1. Sudo gedit/etc/vsftpd.conf
Add: Local_root=/home/ftpdir
The
First, remove the current path:
Base_dir1 = Os.path.dirname (Os.path.dirname (__file__))
Base_dir2 = Os.path.dirname (Os.path.abspath (__file__))
# __file__: Refers to the directory address where this file resides (including the file name) but is
__init__ Method Introduction:If a base class has an __init__ () method The derived class "s __init__ () method must explicitly call it to ensure proper in Itialization of the base class part of the instance; For example: "Baseclass.__init__ (self,
stdin, stdout, and stderr variables contain stream objects that correspond to standard I/O streams.
If we need to better control the output, and print does not meet our requirements, they are what we need.
They can also be replaced by redirecting
The SYS module includes a set of very useful services that contain a number of function methods and variables to handle the Python run-time configuration and resources to interact with the system environment outside of the previous program, such as
in the Python function, enter the keyword parameter--the dictionary parameter, how to output in the order of input.
For ease of understanding, cite several examples: example one:
https://www.zhihu.com/question/24360507
#编写者
def Test (**kwargs):
The strip in Python is used to remove the first (left) character of a string, and Lstrip is used to remove the left character, Rstrip to remove the right character. All three functions can pass in one parameter, specifying the first and last
Variable object and type relation function cannot change parameter pass can change parameter pass
variables, objects, and type relationships
Python is a dynamic type language and does not need to declare a variable type beforehand, and the type and
Preface in Python, there are several ways to define and transfer function parameters:
syntax
meaning
def func (name)
general parameters can To match the position according to the location, or you can match the
1. The scope of the code in which variables function is referred to as variables, and the variables in different scopes do not affect each other. The variables defined inside the function are local variables, and the variables defined outside the
The SYS module can obtain command-line parameters, implement the function of passing parameters from outside the program to the program, and obtain the program path and the information of the current platform.
1.sys.plateform Current operating
Python2 and Python3 properties of the processing and implementation is not the same, the internal implementation of a large difference, this article refers to the concept of narrow sense.
I. Attributes in the Python2
Attributes are declared using
Python is a weakly typed language, and many of the friends who turn from C + + are not very comfortable at first. For example, when declaring a function, you cannot specify the type of the parameter. The analogy with C is that all parameters are
These methods are located in the random module
Random.random (), Math.random () with JavaScript, returns a floating-point number between [0.0,1)
Random.uniform (A, B), returns the floating-point number between [a,b]
The Python code print
There are eight methods of selenium positioning, ID, name, class, tag, Link_text, Partial_link_text, CSS, XPath
1. Locating elements with ID
#coding =utf-8 from
Selenium import webdriver
import time
driver =webdriver. Firefox ()
driver.get ('
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