随笔分类 -  python

Python初学——多进程Multiprocessing
摘要:1.1 什么是 Multiprocessing 多线程在同一时间只能处理一个任务。 可把任务平均分配给每个核,而每个核具有自己的运算空间。 1.2 添加进程 Process 与线程类似,如下所示,但是该程序直接运行无结果,因为IDLE不支持多进程,在命令行终端运行才有结果显示 1.3 存储进程输出 阅读全文

posted @ 2018-07-12 09:02 Anita_harbour

Python初学——多线程Threading
摘要:接着上篇继续跟着沫凡小哥学Python啦 1.1 什么是多线程 Threading 多线程可简单理解为同时执行多个任务。 多进程和多线程都可以执行多个任务,线程是进程的一部分。线程的特点是线程之间可以共享内存和变量,资源消耗少(不过在Unix环境中,多进程和多线程资源调度消耗差距不明显,Unix调度 阅读全文

posted @ 2018-07-12 09:00 Anita_harbour

pyinstaller打包多个py文件和去除cmd黑框
摘要:1.打包多个py文件并且去除cmd黑框 格式:pyinstaller.exe -F 路径\文件名.py空格路径\文件名.py空格--noconsole pyinstaller.exe -F ui.py --noconsole 阅读全文

posted @ 2018-07-11 14:18 Anita_harbour

python获取当前路径
摘要:import os,sys 使用sys.path[0]、sys.argv[0]、os.getcwd()、os.path.abspath(__file__)、os.path.realpath(__file__) sys.path是Python会去寻找模块的搜索路径列表,sys.path[0]和sys. 阅读全文

posted @ 2018-07-11 14:15 Anita_harbour

windows下手动安装pyinstaller(python2.7)
摘要:1、首先,安装python2.7.13,官网下载msi版(windows直接安装); https://www.python.org/downloads/ 2、然后,到python包官网依次下载,future,prfile,pywin32,pyinstaller这四个包; https://pypi.p 阅读全文

posted @ 2018-07-10 09:56 Anita_harbour

python 添加Windows权限
摘要:# -*- coding: utf-8 -*- """ Created on Mon Jan 8 09:09:51 2018 @author: coordinate """ from __future__ import print_function import os import sys,time import ctypes if sys.version_info[0] == 3: ... 阅读全文

posted @ 2018-07-09 10:01 Anita_harbour

python 查询文件修改python lib 库文件
摘要:运行code python库文件 修改后的库文件 阅读全文

posted @ 2018-07-04 09:56 Anita_harbour

python文件读取,替换(带格式,python lib 库)
摘要:test.log test.txt 阅读全文

posted @ 2018-07-03 13:23 Anita_harbour

python 查询文件存放地址
摘要:import os, time import sys import re def search(path,name): for root, dirs, files in os.walk(path): if name in dirs or name in files: flag = 1 root = str(... 阅读全文

posted @ 2018-07-03 13:18 Anita_harbour