文章分类 - Python 作业
摘要:class FlowEngine(models.Model): """审批流引擎""" name = models.CharField(max_length=128, verbose_name="审批流名称") def __str__(self): return self.name class Meta: verbose...
阅读全文
摘要:获取VM所有Snapshot
阅读全文
摘要:pyvmomi gitub pyVmomi is the Python SDK for the VMware vSphere API that allows you to manage ESX, ESXi, and vCenter. 说明: 该脚本自动从VC中获取VM5个信息; hostname,
阅读全文
摘要:注意: 需要安装firefox的一个插件geckodriver 地址:https://github.com/mozilla/geckodriver/releases,插件放置位置 firefox根目录,然后将firefox目录添加到环境变量中。
阅读全文
摘要:# -*- 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...
阅读全文
摘要:# -*- 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): ...
阅读全文
摘要:改进:python sys.stdout.write 实现更好的输出效果 http://www.cnblogs.com/hongfei/p/3982259.html
阅读全文
摘要:本脚本主要针对 clone出来的 linux vm mac地址和eth0不匹配的问题,只能针对eth0 mac地址修改。
阅读全文
摘要:request.urlopen 请求百度网页 request.Request 携带User-Agent头模拟真实浏览器(header内容是通过chrome浏览器f12 network Doc中Headers的内容) 利用urllib.request.Request urllib.request.ur
阅读全文
摘要:# -*- coding:utf-8 -*- import sqlite3,os,hashlib,time import getpass # pycharm不支持getpass包,请不要在pycharm中执行该程序 # 创建表 def create(conn): conn.execute('''CR
阅读全文
摘要:https://my.oschina.net/duhaizhang/blog/68639
阅读全文
摘要:直接使用多进程来实现会报错: OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted 我们都知道socket是网络上两个
阅读全文
摘要:Server端: Client端:
阅读全文
摘要:实现效果:
阅读全文
摘要:Server端: Server端优化版 Client端: Client端优化版
阅读全文
摘要: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')
阅读全文
摘要: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...
阅读全文
摘要: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 ...
阅读全文