![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
Neil_001
这个作者很懒,什么都没留下…
展开
-
python pyinstaller打包及缺失dll文件及相关库解决方案
一、pyinstaller打包步骤(1) pip install pyinstaller安装成可执行文件(2) pyinstaller -F main.py 执行打包动作,生成可执行程序至dist目录二、如果可执行程序执行报缺少xxx.dll文件解决方式如下:(1) 在python安装目录下的lib/site-packages目录中找到相关的xxx.dll文件,(2) 将xxx.dll文件拷贝到dist生成的可执行文件目录中(3) 修改main.py同目录中的main.spec文原创 2021-11-03 22:57:20 · 12033 阅读 · 1 评论 -
python 更新pip及查看安装包信息
1. 更新pippython -m pip install --upgrade pip2. 查看安装包信息pip show <module-name>eg:pip show tensorflow原创 2020-06-08 00:53:40 · 408 阅读 · 0 评论 -
python 查看版本号 version
1. cmd中: python -V2. cmd中键入python3.进入 pythonimport syssys.version4.进入pythonhelp()原创 2020-05-16 10:27:06 · 2474 阅读 · 0 评论 -
python 安装多版本
1.下载python3.6、python3.82.按默认进行安装,不添加路径到系统path中3.修改系统环境变量python所在目录: C:\Users\<user-name>\AppData\Local\Programs\Python(1)将python36和python38分别添加到系统path中(2)将各自的scripts添加到系统path中上面的为默认启动时优先选择的命令查找路径4.修改命令名称python36中的python.exe复制修改为py...原创 2020-05-16 10:24:41 · 734 阅读 · 0 评论 -
python 离线包 安装包 下载网址
Unofficial Windows Binaries for Python Extension Packagesby Christoph Gohlke, Laboratory for Fluorescence Dynamics, University of California, Irvine.Updated on 4 May 2020 at 18:16 UTC.https://ww...原创 2020-05-06 00:00:10 · 876 阅读 · 0 评论 -
python 最简单的服务
Python2:python2 -m SimpleHTTPServer <port>Python3:python3 -m http.server <port>原创 2020-05-05 23:54:11 · 272 阅读 · 0 评论 -
python 执行shell脚本
python脚本中执行 shell脚本# os.system# winos.system('dir');# linuxos.system('ls -l');# subprocess.run/call#winsubprocess.run('python -m http.server')subprocess.call('python -m http.server')...原创 2020-05-05 23:52:59 · 329 阅读 · 0 评论 -
python ModuleNotFoundError
脚本开头设置路径,避免本地module找不到不能导入# -*- coding: utf-8 -*-import sysimport osmodule_path = os.path.dirname(os.path.abspath(__file__)) # 上级目录sys.path.append(module_path)...原创 2020-05-05 23:42:34 · 201 阅读 · 0 评论 -
python virtualenv 创建本地虚拟环境
1. pycharmNew Project -> Pure Python -> Project Interpreter: New Virtual environment1) 打开cmd:进入venv目录->activate激活, deactivate退出虚拟环境。2) pycharm打开控制台直接激活虚拟环境2.命令行方式pip install vi...原创 2020-04-06 11:39:27 · 395 阅读 · 0 评论 -
python (1) 函数 参数
(素材来源:Python Cookbook中文版,美David Beazley & Brian K. Jones著,陈舸译)一、接受任意数量参数的函数以*打头的参数只能作为最后一个位置参数出现,以**打头的参数只能作为最后一个参数出现。def anyargs(*args, **kwargs): print(args) # tuple print(k...原创 2020-03-28 01:15:23 · 243 阅读 · 0 评论 -
python list
list: append最后追加, pop最后抛出, remove移除第一个, del(l[index]), extend([]),count, index, sort, reverse, [::-1]In [27]: l ...原创 2020-02-22 22:55:06 · 385 阅读 · 0 评论 -
python requests
python3pip install requestsresponse 返回结果 类型 response.json() 返回内容json格式 response.text 返回内容str类型(unicode编码) response.content 返回内容bytes类型 response.headers 响应头 response.re...原创 2020-02-22 16:11:44 · 159 阅读 · 0 评论 -
python yaml
1. yaml文件示例yaml0.yaml- a: b- c: d e: f h: i2.代码In [1]: from ruamel import yamlIn [2]: f = open('yaml0.yaml', 'r')In [3]: a = f.read()In [4]: aOut[4]: '- a: b\n- c: d\n e: f\n...原创 2020-02-19 00:01:29 · 318 阅读 · 0 评论 -
python celery的使用
1. pip install celery2. pip install eventlet3. 编写python程序:#Filename: tasks.py#coding: utf-8from celery import Celeryapp = Celery('tasks', #当前模块名broker = 'amqp://guest@localhost:5672//', #连接...原创 2019-09-28 17:46:14 · 181 阅读 · 0 评论 -
画图
np.arange(-1, 5, 2)->array([-1, 1, 3])np.linspace(-1, 5, 3)->array([-1., 2., 5.])plt.figure(num = 3, figsize = (8,5))plt.plot(x, y2, linestyle = '-.', label = 'AA')plt.plot(x, y1, c...原创 2019-09-23 00:26:30 · 143 阅读 · 0 评论 -
Django的使用
本文仅作笔记使用,取自:https://docs.djangoproject.com/zh-hans/2.1/intro/# 安装 pip install django==version# 查看版本号 python -m django --version1. 创建网站:admin-startproject mysite2. 创建应用:admin-startapp polls...原创 2019-09-23 00:27:37 · 341 阅读 · 0 评论 -
用Python合并多张EXCEL工作表
VBA脚本写的合并多张EXCEL表的地址为: EXCEL VBA 合并多张相同格式的工作表的宏以下是Python脚本编写的用于合并多张excel表的代码:# -*- coding: utf-8 -*-"""Created on Fri Jul 13 18:09:06 2018@author: Neil"""import osimport pandas as pdif __nam...原创 2018-07-13 18:52:03 · 3452 阅读 · 0 评论