![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
我是小妖怪逍遥又自在
生活你全是泪,没死就得活受罪,越是折腾越倒霉,越有追求越悲催,垂死挣扎你累不累,不如瘫在床上睡。来来回回千百遍,小爷也是很疲倦
展开
-
Linux CentOS7 django ModuleNotFoundError: No module named 'Attribute' 0x7f38945526a8
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f38945526a8>Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/django...原创 2019-04-22 10:26:11 · 484 阅读 · 0 评论 -
Django Error: That port is already in use.
1.python manage.py migrate 你会看到如下结果2.ps aux | grep -i manage 查看开启的服务3. sudo kill 30795 (30795是对应的服务ID) 停掉manage开启的服务,ps aux | grep -i manage 查看开启的服务4.python manage.py runserver 0.0.0...原创 2019-04-22 10:36:57 · 977 阅读 · 0 评论 -
Django: ImportError: No module named 'corsheaders' return _bootstrap._gcd_import(name[level:], pack
首先打开 Anconda 下的prompt然后 命令行 pip3 install django-cors-headers然后设置 settings.py 如下# -*- coding:utf-8 -*-import os# Build paths inside the project like this: os.path.join(BASE_DIR, ....原创 2019-04-10 16:28:42 · 6347 阅读 · 0 评论 -
Python 调用局部变量 局部变全局变量
def Psum (): list3 = [[0.8, 0.7, 0.9, 1.0, 1.1], [1.6, 1.7, 1.8, 1.9, 2.0], [2.4, 2.7, 2.3, 2.9, ], [3.8, 3.7, 3.3, 3.4, ]] p1 = [] for i in range(4): list2 = rand...原创 2019-06-20 10:14:48 · 1864 阅读 · 0 评论 -
Python 多维数组 随机按列取值
list3=[[0.8, 0.7, 0.9, 1.0,1.1],[1.6, 1.7, 1.8, 1.9,2.0 ],[2.4, 2.7, 2.3, 2.9, ],[3.8, 3.7, 3.3, 3.4, ]]p1 = []for i in range (4): list2 = random.sample(list3[i], 1) i=+1 p1.append(list...原创 2019-06-04 13:49:28 · 1449 阅读 · 0 评论 -
在Linux安装配置Tomcat 并部署web应用
1、命令行,java -version 检查是否有java环境,没有则需要去安装并配置到环境变量中。2、下载tomcat包,下载地址:http://tomcat.apache.org/download-70.cgi3、 配置Tomcat环境变量 1、新建变量名:CATALINA_HOME,变量值:E:\server\tomcat ...原创 2019-06-04 13:50:41 · 112 阅读 · 0 评论 -
多个一维数组合并为一个多维数组
import numpy as npa=[0.9]b=[2]c=[3]d=[]#目标是d=[[0.9], [2], [3]]法1:d=[a,b,c]法2:d = [l for l in [a, b, c, d] if len(l) > 0]法3:d.append(a)d.append(b)d.append(c)print(d)原创 2019-07-30 10:28:17 · 6484 阅读 · 0 评论