文章分类 -  Python 作业

摘要:class FlowEngine(models.Model): """审批流引擎""" name = models.CharField(max_length=128, verbose_name="审批流名称") def __str__(self): return self.name class Meta: verbose... 阅读全文
posted @ 2017-11-22 22:54 Vincen_shen 阅读(4162) 评论(0) 推荐(0) 编辑
摘要:获取VM所有Snapshot 阅读全文
posted @ 2017-09-23 09:44 Vincen_shen 阅读(436) 评论(0) 推荐(0) 编辑
摘要:pyvmomi gitub pyVmomi is the Python SDK for the VMware vSphere API that allows you to manage ESX, ESXi, and vCenter. 说明: 该脚本自动从VC中获取VM5个信息; hostname, 阅读全文
posted @ 2017-07-13 13:26 Vincen_shen 阅读(780) 评论(0) 推荐(0) 编辑
摘要:结果: 阅读全文
posted @ 2017-06-08 16:55 Vincen_shen 阅读(135) 评论(0) 推荐(0) 编辑
摘要:注意: 需要安装firefox的一个插件geckodriver 地址:https://github.com/mozilla/geckodriver/releases,插件放置位置 firefox根目录,然后将firefox目录添加到环境变量中。 阅读全文
posted @ 2017-05-04 15:43 Vincen_shen 阅读(1196) 评论(0) 推荐(0) 编辑
摘要:# -*- coding:utf-8 -*- # @Time : 2017-03-30 15:26 # @Author : Vincen # @Site : # @File : fortress.py # @Software : PyCharm import paramiko import pymysql from concurrent.futures impor... 阅读全文
posted @ 2017-03-31 10:02 Vincen_shen 阅读(198) 评论(0) 推荐(0) 编辑
摘要:# -*- coding:utf-8 -*- import select import socket sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sk.setblocking(False) sk.bind(("127.0.0.1", 8001)) sk.listen(10) def process_data(conn): ... 阅读全文
posted @ 2017-03-25 10:51 Vincen_shen 阅读(181) 评论(0) 推荐(0) 编辑
摘要:改进:python sys.stdout.write 实现更好的输出效果 http://www.cnblogs.com/hongfei/p/3982259.html 阅读全文
posted @ 2017-03-10 10:06 Vincen_shen 阅读(235) 评论(0) 推荐(0) 编辑
摘要:本脚本主要针对 clone出来的 linux vm mac地址和eth0不匹配的问题,只能针对eth0 mac地址修改。 阅读全文
posted @ 2017-03-08 13:56 Vincen_shen 阅读(346) 评论(0) 推荐(0) 编辑
摘要:requests.get下载图片 阅读全文
posted @ 2017-02-10 15:21 Vincen_shen 阅读(335) 评论(0) 推荐(0) 编辑
摘要:request.urlopen 请求百度网页 request.Request 携带User-Agent头模拟真实浏览器(header内容是通过chrome浏览器f12 network Doc中Headers的内容) 利用urllib.request.Request urllib.request.ur 阅读全文
posted @ 2017-01-04 22:55 Vincen_shen 阅读(114) 评论(0) 推荐(0) 编辑
摘要:# -*- coding:utf-8 -*- import sqlite3,os,hashlib,time import getpass # pycharm不支持getpass包,请不要在pycharm中执行该程序 # 创建表 def create(conn): conn.execute('''CR 阅读全文
posted @ 2016-12-29 23:31 Vincen_shen 阅读(6365) 评论(0) 推荐(0) 编辑
摘要:https://my.oschina.net/duhaizhang/blog/68639 阅读全文
posted @ 2016-12-19 23:21 Vincen_shen 阅读(155) 评论(0) 推荐(0) 编辑
摘要:直接使用多进程来实现会报错: OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted 我们都知道socket是网络上两个 阅读全文
posted @ 2016-12-18 22:50 Vincen_shen 阅读(750) 评论(0) 推荐(0) 编辑
摘要:Server端: Client端: 阅读全文
posted @ 2016-12-18 22:22 Vincen_shen 阅读(400) 评论(0) 推荐(0) 编辑
摘要:实现效果: 阅读全文
posted @ 2016-12-18 21:22 Vincen_shen 阅读(557) 评论(0) 推荐(0) 编辑
摘要:Server端: Server端优化版 Client端: Client端优化版 阅读全文
posted @ 2016-12-17 22:51 Vincen_shen 阅读(965) 评论(0) 推荐(0) 编辑
摘要:for i in range(1,10): for n in range(1,i+1): print("%d*%d=%d\t"%(n,i,n*i),end="") if n==i: print('\n') 阅读全文
posted @ 2016-12-05 15:36 Vincen_shen 阅读(163) 评论(0) 推荐(0) 编辑
摘要:import os,pickle,collections def query(file): with open("class_info.pkl","rb") as f: info = pickle.load(f) print(info) class School(object): school_info,course_info,teacher_info... 阅读全文
posted @ 2016-12-01 15:11 Vincen_shen 阅读(188) 评论(0) 推荐(0) 编辑
摘要:import os,shutil class Copy_file(object): def __init__(self,src_file,dst_file,file_type): self.src_file = src_file self.dst_file = dst_file self.file_type = file_type ... 阅读全文
posted @ 2016-11-17 23:14 Vincen_shen 阅读(217) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示