Crawling knowledge planet with python

Last year, we did a community activity called "question and answer for seniors", which precipitated a lot of valuable interactive information, and then it was terminated for various reasons. Today, I started to talk with Tu Teng, and thought that the information was so quiet and wasteful. So try to use python to crawl the content of t ...

Posted by kylera on Sat, 07 Dec 2019 21:05:17 -0800

Coin station log 1 -- Python 3 crawler crawling blockchain news

Coin station log 1 -- Python 3 crawler crawling blockchain news Blockchain is very popular recently, so I want to be a news crawling and analysis type media website. I can do it as soon as I say, but I always need a data source to be a media website. Where does the data source come from? I'll write this thing later. First, crawling... Anyway, ...

Posted by sotusotusotu on Sat, 07 Dec 2019 19:02:41 -0800

Variables and function return values in Python functions

1. Variable of function Local and global variables: Any variable in Python has a specific scope Variables defined in a function can only be used inside the function, and those variables that can only be used in specific parts of the program are called local variables Variables defined at the top of a file can be called by any function in the fi ...

Posted by cactus on Sat, 07 Dec 2019 18:27:45 -0800

aiohttp web provides file download service

python3.6Using aiohttp, aiofiles library, asynchronous operationThe server code is as follows. After starting the service, it will listen to 0.0.0.0:8080 by defaultNo exception handling, applicable to small files, for reference only file_server.py: import aiofiles import asyncio import os from aiohttp.web import Response from aiohttp import we ...

Posted by LarryK on Sat, 07 Dec 2019 17:50:42 -0800

Palindrome substring

Palindrome substring describe Given a string, your task is to calculate how many palindrome substrings are in the string. A substring with different start or end positions is counted as a different substring, even if it is composed of the same characters. Example 1: Input: "abc" Output: 3 Explanation: three palind ...

Posted by sowmithrii on Sat, 07 Dec 2019 17:10:04 -0800

Usage record of setuptools

Writing skills of python setup.py file Environment: the latest version of setuptools. For a preliminary understanding of setuptools, please refer to This article 1. Custom command from setuptools import setup, Command class MyCommand(Command): description = "Description of the command" user_options = [] # This method ...

Posted by antileon on Sat, 07 Dec 2019 17:01:47 -0800

Online Process Recording for Network Deployment

Online Process Recording for Network Deployment Take the example of recommending similar items: reco-similar-product Project Directory Dockerfile Jenkinsfile README.md config deploy.sh deployment.yaml index offline recsys requirements.txt service stat You can see that there are many files in the directory. Here is a brief description of the rol ...

Posted by tomasd on Sat, 07 Dec 2019 13:38:56 -0800

[Xuefeng magnetic needle stone blog] python 3.7 quick start tutorial 7 Internet

Contents of this tutorial 7 Internet Internet access urllib urllib is a Python module for opening URL s. import urllib.request # open a connection to a URL using urllib webUrl = urllib.request.urlopen('https://china-testing.github.io/address.html') #get the result code and print it print ("result code: " + str(webUrl.getcode())) # read the d ...

Posted by esport on Sat, 07 Dec 2019 09:41:08 -0800

Why do I recommend Python as a second language for the front end?

Preface The text and pictures of this article are from the Internet, only for learning and communication, not for any commercial purpose. The copyright belongs to the original author. If you have any questions, please contact us in time for handling. Author: front-end counselor PS: if you need Python learning materials, you can click the link b ...

Posted by dape2009 on Sat, 07 Dec 2019 07:19:50 -0800

Development of django - configuration and use of mongodb

Today, I sorted out how to use mongodb in django project. The environment is as follows:ubuntu18.04, django2.0.5, drf3.9, mongoengine0.16 Step 1: configure mongodb and mysql in settings.py as follows (you can use both mysql and mongodb): DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # database engine 'NA ...

Posted by nimbus on Sat, 07 Dec 2019 05:53:20 -0800