[Flask] template rendering

Backstage from flask import Flask,render_template,request,redirect,session,url_for,jsonify,make_response,Markup,flash,get_flashed_messages app = Flask(__name__) app.config.from_object("settings.DevelopmentConfig") STUDENT_DICT = { 1:{'name':'Wang Long Tai','age':38,'gender':'in'}, 2:{'name':'Small Northeast','age':7 ...

Posted on Mon, 18 Nov 2019 10:15:08 -0500 by rodin

Python selenium element positioning

I. html The following HTML file is the form.html to be used later. The page is roughly as follows: <!DOCTYPE html> <html> <head> <title>Search element</title> <meta charset="utf-8"> </head> <body> <div id="container"> <form> user:<input type="text" n ...

Posted on Mon, 18 Nov 2019 09:40:49 -0500 by Zack

Python logging module logging

Official documents: https://docs.python.org/2/library/logging.html I. log level The logging module provides a standard log interface, which can record our daily operations and store logs of various formats. The log level of logging is from low to high as debug(), info(), warning(), error() and critical() CRITICAL(50) > ERROR(40) > WAR ...

Posted on Mon, 18 Nov 2019 04:50:41 -0500 by Kenwio

Implementation principle of movie recommendation system and download of Python source code

In this tutorial, we will implement a recommendation system based on the similarity of movie content itself. We will use natural language processing/ NLP Technology to extract the features of each movie, then establish cosine similarity matrix between different movies, and finally use the similarity matrix to recommend the 10 most similar movie ...

Posted on Mon, 18 Nov 2019 04:41:27 -0500 by westair

URL encoding and decoding (using Python 3 urllib. Parse) and post bar crawler case

I. parse.urlencode() and parse.unquote() Both urllib and urllib.request are related modules that accept URL requests, but they provide different functions. The two most significant differences are as follows: 1.urllib can only accept URL s, and cannot create an instance of the Request class with headers set; 2. But urllib provides urlencode me ...

Posted on Sun, 17 Nov 2019 17:51:59 -0500 by slapdashgrim

python uses xlwt module to operate Excel

Part of it is from the official website The module is easy to install $ pip install xlwt Let's start with a simple example: #!/usr/bin/python #coding=utf-8 # ============================================================================== # # Filename: demo.py # Description: excel operat # Created: Tue Apr 25 1 ...

Posted on Sun, 17 Nov 2019 17:31:30 -0500 by cmack

Automatic instruction script and self writing script of SecureCrt

Introduction Recently, when debugging the wifi driver of the device, when testing the throughput, you need to repeatedly input instructions and view the relevant print information. The test time is long. In order to save time and effort, you can use the recording function of SecureCrt plus simple modification to realize the au ...

Posted on Sun, 17 Nov 2019 16:28:31 -0500 by stormchaser1_1

Image preprocessing using tensorflow's own function

I. method Image reading, clipping, inverting, and changing colors involve the following functions: Read: tf.gfile.FastGFile(path,decodestyle) //Tailoring: tf.image.sample_distorted_bounding_box(image_size,bounding_boxes) tf.slice(image, bbox_begin, bbox_size) tf.image.resize_images(image, [height, width], method) //Reversal: t ...

Posted on Sun, 17 Nov 2019 10:05:28 -0500 by runner

Web Front End Foundation: HTML

1. Related tags in body 1.1 Title Label: hn HTML provides <hn> series of tags to modify tags, including: <h1>, <h2>, <h3>, <h4>, <h5>, <h6>.<h1>Define the largest title.<h6>Define the smallest title. For example: <html> <head> <meta charset="utf-8"/> &l ...

Posted on Sun, 17 Nov 2019 02:43:00 -0500 by torrentmasta

Two ways to create a process

In both ways, multiprocessing module is used to import Process class to realize specific methods The first is: from multiprocessing import Process import time # Subroutine code created def task(name): print('%s is running' % name) time.sleep(2) print('%s is over' % name) # Notice that windows In the system, the crea ...

Posted on Sat, 16 Nov 2019 17:26:40 -0500 by donturo