09 2017 档案
PyQt4 进度条和日历 代码
摘要:进度条效果 日历效果 阅读全文
posted @ 2017-09-30 23:07 神秘藏宝室 阅读(381) 评论(0) 推荐(0)
PyQt4 颜色选择,字体选择代码
摘要:``` # -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: buttonTest Description : Author : 神秘藏宝室 date: 2017-09-30 -------------------... 阅读全文
posted @ 2017-09-30 23:06 神秘藏宝室 阅读(1054) 评论(0) 推荐(0)
PyQt4调用UI文件
摘要:方法1,转换到py调用 指令 方法2.直接调用ui文件 阅读全文
posted @ 2017-09-27 23:19 神秘藏宝室 阅读(877) 评论(0) 推荐(0)
PyQt4设置窗口左上角的小图标
摘要:``` # -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: icon Description : Author : 神秘藏宝室 date: 2017-09-25 -------------------------... 阅读全文
posted @ 2017-09-25 23:27 神秘藏宝室 阅读(2223) 评论(0) 推荐(0)
PyQt4测试安装ok的程序
摘要:``` # -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: simple Description : Author : 神秘藏宝室 date: 2017-09-25 -----------------------... 阅读全文
posted @ 2017-09-25 23:14 神秘藏宝室 阅读(310) 评论(0) 推荐(0)
from PyQt4.QtGui import * 提示 ImportError: DLL load failed: %1 is not a valid Win32 application.
摘要:个人用64位电脑安装了64位的PyQt后 from PyQt4.QtGui import 提示 ImportError: DLL load failed: %1 is not a valid Win32 application. 后卸载64位的PyQt后,再装32位的PyQt后则成功。目测是之前装的 阅读全文
posted @ 2017-09-25 23:07 神秘藏宝室 阅读(787) 评论(0) 推荐(0)
Python爬虫:爬取自己博客的主页的标题,链接,和发布时间
摘要:代码 结果 阅读全文
posted @ 2017-09-21 23:01 神秘藏宝室 阅读(682) 评论(0) 推荐(0)
运行jupyter notebook 出错 Error executing Jupyter command 'notebook'
摘要:实际上是安装jupyter时候有错误, 仔细看日志发现需要缺少 Microsoft Visual C++ Compiler for Python 2.7 下载安装后,重新安装jupyter即可 阅读全文
posted @ 2017-09-17 22:10 神秘藏宝室 阅读(1179) 评论(0) 推荐(0)
安装和使用jupyter
摘要:安装 使用 阅读全文
posted @ 2017-09-17 00:25 神秘藏宝室 阅读(199) 评论(0) 推荐(0)
windows下python调用c文件流程
摘要:1.新建fun.c文件和fun.h文件 3.CMD使用指令 这里我出错了python Unable to find vcvarsall.bat 错误, 参考上一篇日志python Unable to find vcvarsall.bat 错误解决方法。解决了。 然后生成出fun.pyd文件 4.复制 阅读全文
posted @ 2017-09-16 00:01 神秘藏宝室 阅读(690) 评论(0) 推荐(0)
python Unable to find vcvarsall.bat 错误
摘要:python 2.7在setup的时候查找的是VS2008编译的。果你电脑上没有这个版本的话,比如只有: 1. Visual Studio 2010,在cmd里面执行: 2. Visual Studio 2012 的话: 以此类推: 3. Visual Studio 2013 的话: 4. Visu 阅读全文
posted @ 2017-09-15 23:30 神秘藏宝室 阅读(163) 评论(0) 推荐(0)
阿里云公网IP不能使用
摘要:1.开通专用网络 2.在ECS的安全组 创建 专用网络 3.配置规则 4.快速创建规则,增加自己需要入网的端口号,授权对象写:0.0.0.0/0 阅读全文
posted @ 2017-09-14 22:36 神秘藏宝室 阅读(482) 评论(0) 推荐(0)
Python2 socket TCPServer 多线程并发 超时关闭
摘要:在阿里云上测试过,可以直接使用。 用IP和端口发送数据,会返回echo:+接收到的数据 阅读全文
posted @ 2017-09-14 22:27 神秘藏宝室 阅读(732) 评论(0) 推荐(0)
Python2 socket 多线程并发 ThreadingTCPServer Demo
摘要:``` # -*- coding:utf-8 -*- from SocketServer import TCPServer, StreamRequestHandler import traceback class MyStreamRequestHandlerr(StreamRequestHandler): """ #继承StreamRequestHandler,并重写hand... 阅读全文
posted @ 2017-09-11 21:50 神秘藏宝室 阅读(1041) 评论(0) 推荐(0)
Python2 socket 多线程并发 TCPServer Demo
摘要:``` #coding=utf-8 import socket import threading,getopt,sys,string opts, args = getopt.getopt(sys.argv[1:], "hp:l:",["help","port=","list="]) #设置默认的最大连接数和端口号,在没有使用命令传入参数的时候将使用默认的值 list=50 port=8001 d... 阅读全文
posted @ 2017-09-11 21:28 神秘藏宝室 阅读(281) 评论(0) 推荐(0)
Python socket TCPServer Demo
摘要:``` #coding:utf-8 from SocketServer import TCPServer,BaseRequestHandler import traceback class MyBaseRequestHandler(BaseRequestHandler): """ #继承BaseRequestHandler的handle方法 """ def han... 阅读全文
posted @ 2017-09-11 20:59 神秘藏宝室 阅读(516) 评论(0) 推荐(0)
Python socket server demo
摘要:``` #coding:utf-8 from socket import * #开启ip和端口 ip_port = ("192.168.1.103",8088) print ip_port sockobj = socket(AF_INET,SOCK_STREAM) sockobj.bind(ip_port) sockobj.listen(128) #同时允许128个链接 while True:... 阅读全文
posted @ 2017-09-11 20:32 神秘藏宝室 阅读(407) 评论(0) 推荐(0)
python2 生成验证码图片
摘要:使用pillow或者pil库编写 阅读全文
posted @ 2017-09-07 21:52 神秘藏宝室 阅读(260) 评论(0) 推荐(0)
python3 计算文件夹中所有py文件里面代码行数,注释行数,空行数
摘要:``` import os,re 代码所在位置 FILE_PATH = './' def analyze_code(codefilesource): ''' 打开一个py文件统计其中的代码行数,包括空格和注释 返回该文件总行数,注释函数,空行输 :param codefilesource: :ret 阅读全文
posted @ 2017-09-05 22:54 神秘藏宝室 阅读(354) 评论(0) 推荐(0)
python3 str和bytes转换
摘要:``` bytes object b = b"example" str object s = "example" #str to bytes bytes(s, encoding = "utf8") #bytes to str str(b, encoding = "utf-8") #an alternative method ... 阅读全文
posted @ 2017-09-05 22:52 神秘藏宝室 阅读(203) 评论(0) 推荐(0)
python3 批量缩放图片为iphone5的640*1136以下
摘要:``` try: from PIL import Image, ImageDraw, ImageFont, ImageEnhance except ImportError: import Image, ImageDraw, ImageFont, ImageEnhance import os myPath = './srcimg/' outPath = './destimg/' ... 阅读全文
posted @ 2017-09-05 21:00 神秘藏宝室 阅读(255) 评论(0) 推荐(0)
python 统计单词出现次数
摘要:``` #use python3.6 import re from collections import Counter FILESOURCE = './abc.txt' def getMostCommonWord(artlclefilesource): pattern = r"""[A-Za-z]+|\$?\d+%?$""" with open(artlclefilesourc... 阅读全文
posted @ 2017-09-05 17:31 神秘藏宝室 阅读(489) 评论(0) 推荐(0)
python3 生成随即激活码
摘要:``` import string import random #激活码中的字符和数字 field = string.ascii_letters + string.digits #获得四个字母和数字的随即组合 def getRandom(): return "".join(random.sample(field,4)) #生成的每个激活码中有几组 def concatenate(gr... 阅读全文
posted @ 2017-09-05 17:09 神秘藏宝室 阅读(302) 评论(0) 推荐(0)
python3 pillow使用测试
摘要:``` encoding=utf 8 ''''' pil处理图片,验证,处理 大小,格式 过滤 压缩,截图,转换 图片库最好用Pillow 还有一个测试图片img.jpg, 一个log图片,一个字体文件 ''' 图片的基本参数获取 try: from PIL import Image, ImageD 阅读全文
posted @ 2017-09-05 13:58 神秘藏宝室 阅读(867) 评论(0) 推荐(0)
python3里面的图片处理库 pillow
摘要:在python2下用pil,而在python3下可以安装pillow 功能,在图片上加上几个字 阅读全文
posted @ 2017-09-05 13:31 神秘藏宝室 阅读(1014) 评论(0) 推荐(0)
python发布包流程
摘要:1.新建文件夹suba和subb,文件夹下新建__init__.py,内容可以为空 2.suba内新建文件aa.py bb.py 3.subb内新建文件cc.py dd.py 4.setup.py文件内容 5.然后 阅读全文
posted @ 2017-09-04 21:57 神秘藏宝室 阅读(295) 评论(0) 推荐(0)
python3.x中如何实现print不换行
摘要:大家应该知道python中print之后是默认换行的, 那如何我们不想换行,且不想讲输出内容用一个print函数输出时,就需要改变print默认换行的属性, 方法如下: print('contents', end='!@ $%^& ') end就表示print将如何结束,默认为end="\n"(换行 阅读全文
posted @ 2017-09-01 20:56 神秘藏宝室 阅读(220) 评论(0) 推荐(0)


 >>>转载请注明出处<<<