Summary: On Linux servers or Python-installed machines, you can use nohup python-m SimpleHTTP Server [port] amp; quickly build an HTTP service.
Python comes with a Web server, SimpleHTTP Server, on a Linux server or on a machine with Python installed.
We can easily use python-m SimpleHTTP Server to quickly build an HTTP service that provides a web service for browsing files.
WindowsSystem operation is as follows
step1:Open the CMD command window
Enter the path of the project
step2:Start service
The order is as follows:
python -m SimpleHTTPServer 8000
Using the above command, you can pub...
PyCharm is a powerful Python IDE, and PEP 8 alerts are also useful, but the function name can’t contain capital letters and a few other specifications really feel bad, as a Virgo obsessive compulsive disorderPatients, the wave line below the code is absolutely not allowed to exist.
File -> Settings -> Editor -> Inspections -> right side Python”
PEP 8 naming convention violation alarm ID view”https://pypi.org/project/pep8-naming/
code
sample message
N801
class names should use CapWords Convention”
N802
function name should be lower...
After a night’s ride, we finally installed the scrapy framework this morning. In this regard
I install it according to this installation method. It is also encountered all kinds of difficulties, one afternoon plus a morning fight! At last!
$Date_1 = date("Y-m-d");
$Date_2 = "2018-8-20";
$d1 = strtotime($Date_1);
$d2 = strtotime($Date_2);
$Days = ($d2-$d1)/3600/24;
echo "Difference.$Days . ""Heaven";
function prDates($start,$end){ // All dates between two dates
$dt_start = strtotime($start);
$dt_end = strtotime($end);
while ($dt_start<=$dt_end){
echo date('Y-m-d',$dt_start)."\n";
$dt_start = strtotime('+1 day',$dt_start);
}
}
prDates('2005-02-01','2005-02-05');
selenium+pythonAutomatic 99– file download pop-up processing (PyKeyboard)
Original: Shanghai leisurely Learning automation test from scratch
Learning automation test from scratch
Wechat number yoyoketang
Functional introduction This public number is dedicated to automated testing and will continue to update automation tutorials covering selenium, appium, python, interface automation, robot framework, jmeter, fiddler, etc.
this
Preface
In the web automation download operation, sometimes pop-up download box, this kind of download box does not belong to the web page, is unabl...
Preface
Using Python undoubtedly reduces many rule constraints and development costs, allowing us to focus more on logic than syntax. But gains and losses, development efficiency improved, but has brought operational performance problems, so it is often pursued by other schools of thunder.
As a pythoner, we are also very sad, blame us.
Fortunately, God closed one of our doors, but he opened another window for us, because the bottom layer was written in C, so we could rewrite some of the more performance-hungry features, or modules, in C, and then import XXXXXX seamlessly.Combination.
Even if ...
recursive directory generator mode, else in the TMPShow that getting yield is indispensable, and if you want to use a generator in a recursive algorithm, you need to explicitly get all yield values in the generator’s original function (first call)
def get_file_recur(path):
children = os.listdir(path)
for child in children:
qualified_child = os.path.join(path,child)
if os.path.isfile(qualified_child):
yield qualified_child
else:
tmp = get_file_recur(qualified_child)
for item in tmp:
yield item
for file ...
Reading catalogues
1. What is XML? What are the characteristics?
2. Get tag properties
3. Get child Tags
4. Get label attribute values
5. Get data between labels pairs
6. Example
7. summary
Back to the top
1. What is XML? What are the characteristics?
xmlThat is,Extensible markup language,It can be used to mark up data and define data types. It is a source language that allows users to define their own markup language.
Example: del.xml
Structurally, it is much like the HTML hypertext markup language. But they are designed for different purposes. Hypertext markup languages are des...