Crete virtualenv12345678910111213pip install pipenvmkdir websitecd websitepipenv shell --python 3.6pipenv install djangopipenv install pymysqlpipenv install gunicorn
when runnin...
If the strucutre of data is:1234567d1={'name':'zhangsan','age':20,'country':'China'}d2={'name':'w...
Example is following:
1234567891011121314151617181920212223242526from flask import Flaskfrom time import sleepfrom concurrent.futures import ThreadPoolExecutorexecutor = ThreadP...
123456789x = 'abc'# string to bytesb = bytes(x, encoding='utf-8')#butes to strs = str(b, encoding='utf-8')
Check current shell:
123# echo $SHELL/bin/sh
Change shell to /bin/bash:
1# usermod -s /bin/bash <username>
Original source is here
The Python programming language has become one of the most popular languages used in IT. One reason for this success is it can be used to solve a variety...
Translate from krzysztofzuraw
First of all, what I want to accomplish here is to give you basic examples of how to mock data using two tools: mock and pytest monkeypatch.
Why bo...
Translate from Randy Daw-Ran Liou
This is a challenge. I challenge you to avoid writing for-loops in every scenario. Also, I challenge you to find the scenarios that are so fre...
http://www.csdn.net/article/1970-01-01/2822858
电商的秒杀和抢购,对我们来说,都不是一个陌生的东西。然而,从技术的角度来说,这对于Web系统是一个巨大的考验。当一个Web系统,在一秒钟内收到数以万计甚至更多请求时,系统的优化和稳定至关重要。这次我们会关注秒杀和抢购的技术实现和优化,同时,从技术层面揭开,为...
http://www.csdn.net/article/2014-11-06/2822529
当一个Web系统从日访问量10万逐步增长到1000万,甚至超过1亿的过程中,Web系统承受的压力会越来越大,在这个过程中,我们会遇到很多的问题。为了解决这些性能压力带来问题,我们需要在Web系统架构层面搭建多个层次的缓存机制。在不同的压力阶段,我们会遇到不同的...