First, open the Sublimetext, find the tools--> compiler system--> The new compilation system in the menu bar
Two. Enter the following configuration in the new configuration file
{
"cmd": ["**********" "U", "$file"],
"File_regex":
command line mode and Python interaction mode
1. In command line mode, you can execute Python into the Python interactive environment, or you can
Line Python hello.py run a. py file.
2. In the python interactive environment, only Python code can be
First, let's install Python.
1, first access to the Web site download: Click on the Open link (or enter your own URL https://www.python.org/downloads/), after entering the following figure, select the red circle in the image of the region to
During the Python development process, you should avoid importing loops (cross-references), but if you develop a large Python project, you are likely to get caught up in this situation.
Some of the more plausible methods are:
1. Place the
1.pyhton Assertion
How to add an exception parameter for an ASSERT assertion statementThe assert exception parameter, in fact, is to add string information after the assertion expression to explain the assertion and better know where the problem is.
#-*-Coding:utf-8-*-
"""
Created on Mon Nov 28 13:22:08 2016
@author: yy
"""
# # Part1: Model Training
Import Pandas as PD
Import NumPy as NP
Import OS
From datetime import datetime
Import Xgboost as XGB
Traindata=pd.read_csv
This article lists the differences between Python 2 and Python 3. This is an incomplete list and will be replenished gradually in the future.
1. Print output
Suppose you want to output "HI", let's look at Python 2 and Python 3 in their own notation.
If you want to pass the parameters to the Python script, what is the corresponding argc in Python, argv (the command line argument for C language)?Required module: SYSNumber of parameters: Len (SYS.ARGV)Script Name: sys.argv[0]Parameter 1:sys.argv[1]
In many cases, data literacy is not necessarily a file, it can be read and written in memory.
Stringio, as the name suggests, reads and writes STR in memory.
To write Str to Stringio, we need to first create a stringio, and then write it like a
Iamlaosong Wen
We are using for ... in ... Statement loop, the object required to follow in the following is an iterative object, that is, an object that can be directly applied to a for loop is called an iterative object (iterable), such as list,
Python is all about the object.
1. Each import statement tries to import only one module to avoid importing multiple modules at a time
2. If the statement is too long, you can use a continuation character ' \ ' at the end of the line to indicate
def getrand (num, many): # num is the number of digits; Many: is the number for
x in range (many):
s = "" for
I in range (num):
n = Random.ran Dint (1, 2) #n = 1 Generate a digital n=2 generate the letter
#简单的图形界面GUI (graphical User Interface) from tkinter import * Import Tkinter.messagebox as MessageBox class application (Fram E): #从Frame派生出Application类, it is the parent container def __init__ (self,master = None) of all widgets: #master即是窗口管理器, for
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 ('
Parameters for functions in Python
Formal parameters: A formal parameter that represents a function when a function is defined
Arguments: Actual arguments passed in when the function is called
Columns such as:
def f (x,y): # x,y Formal
First, the ZMQ source code installation
1. Download the LIBZMQ Source:
Git clonehttps://github.com/zeromq/libzmq
2. Execute the following order sequentially:
./autogen.sh (to execute this command, you need to install some tools, sudo apt-get
Computer WIN10 Professional Edition, Python version 3.6.3
Building ' Crypto.Random.OSRNG.winrandom ' extension This error is basically a problem with environmental variables.
In cmd mode, enter set to view environment variables, set variable
1.URLError
The reasons for the Urlerror:
(1) No connection to the network, that is, the computer can not access
(2) Not connected to a specific server
(3) server does not exist
Import urllib.request
import urllib.error from
urllib.request import
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