-
用Python dpkt 来解析 pcap ,,
所属栏目:[Python] 日期:2020-12-17 热度:107
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 import pcap,dpkt,dnetimport sysclass Readpcap(): def __init__(self): self.pc = pcap.pcap("aaa.pcap",False) def printsocket(self): while True[详细]
-
apriori算法
所属栏目:[Python] 日期:2020-12-17 热度:179
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 """Description : Simple Python implementation of the Apriori AlgorithmUsage: $python apriori.py -f DATASET.csv -s minSupport -c minConfidenc[详细]
-
python实现汉诺塔
所属栏目:[Python] 日期:2020-12-17 热度:105
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 def printMove(fr,to):print 'move from ' + str(fr) + ' to ' + str(to)def Towers(n,fr,to,spare):if n == 1:printMove(fr,to)else:Towers(n-1,spar[详细]
-
原 第三方Linux版网易云音乐 (遇到登陆错误,还请update软件)
所属栏目:[Python] 日期:2020-12-17 热度:169
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 print("Mv has come") 以上是编程之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。 如果觉得编程之家网站内容[详细]
-
python黑客写阶乘
所属栏目:[Python] 日期:2020-12-17 热度:83
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 import sys@tailcalldef fact(x,acc=1): if x: return fact(x.__sub__(1),acc.__mul__(x)) return accsys.stdout.write(str(fact(6)) + 'n') 以上是[详细]
-
pygame wormy 贪吃蛇
所属栏目:[Python] 日期:2020-12-17 热度:104
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 import pygame,sys,randomfrom pygame.locals import*FPS = 10winx = 640winy = 480cellsize = 20assert (winx%cellsize == 0 and winy%cellsize == 0[详细]
-
# 根据比例求角度
所属栏目:[Python] 日期:2020-12-17 热度:51
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 from math import *degrees(asin(0.5)) 以上是编程之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。 如果觉得[详细]
-
python删除特定文件
所属栏目:[Python] 日期:2020-12-17 热度:105
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/python# -*- coding: utf-8 -*-import osdef del_files(path): for root,dirs,files in os.walk(path): for name in files: if name.endsw[详细]
-
地月关系统模拟图示
所属栏目:[Python] 日期:2020-12-17 热度:106
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/env python3""" turtle-example-suite: tdemo_planets_and_moon.pyGravitational system simulation using theapproximation method from[详细]
-
演示可变参数函数
所属栏目:[Python] 日期:2020-12-17 热度:181
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #演示可变参数函数#!/usr/bin/pythondef f1(a,b): print a,bdef f2(a,*b): print a,bdef f3(a,**b): print a,bdef f4(a,*b,**c): print a,b,cdef f5(a[详细]
-
每日迅雷会员爬虫
所属栏目:[Python] 日期:2020-12-17 热度:56
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #coding=utf8import urllib2import codecsimport reimport timefrom lxml import etreeurl1 = 'http://521xunlei.com/portal.php'path1 = '//*[@id="p[详细]
-
python实现将excel数据添加到mongodb
所属栏目:[Python] 日期:2020-12-17 热度:107
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 在做文本处理时,有一些数据存储到了excel中,为了将数据导入mongodb,引入了pymongo,xlrd包 #coding=utf-8 import xlrdimport sysimport jsonimport[详细]
-
Django简单网站后台
所属栏目:[Python] 日期:2020-12-17 热度:54
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 以上是编程之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。 如果觉得编程之家网站内容还不错,欢迎将编程之家[详细]
-
汉诺塔实现
所属栏目:[Python] 日期:2020-12-17 热度:69
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # -*- coding: utf-8 -*-def move(n,A,B,C):if n = 0:returnif n == 1:print('move','#1---------',C)returnif n == 2:print('move',B)print('move','[详细]
-
一行代码系列
所属栏目:[Python] 日期:2020-12-17 热度:98
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # 求x以内的所有平方数:[x for x in xrange(1,100) if not x % math.sqrt(x)]# 求x以内(不包括x)的所有质数:filter(lambda x : not [x % i for i in[详细]
-
python写个进程监控的脚本
所属栏目:[Python] 日期:2020-12-17 热度:178
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 class_config.py #!/usr/bin/env python #coding:utf-8 '''''此处定义邮件的相关参数''' class Mail_conf(): sender = '[email?protected]' receiver[详细]
-
Python操作Word批量生成文章
所属栏目:[Python] 日期:2020-12-17 热度:105
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 需要做一些会议记录。总共有多少呢?五个地点x7个月份x每月4篇=140篇。 虽然不很重要,但是140篇记录完全雷同也不好。大体看了一下,此类的记录大致分[详细]
-
20行构建哈夫曼树
所属栏目:[Python] 日期:2020-12-17 热度:163
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 import random#定义节点class Node: def __init__(self,weight=0,left=None,right=None): self.weight=weight self.left=left self.right=right#按权[详细]
-
monkeyrunner 代码示例
所属栏目:[Python] 日期:2020-12-17 热度:106
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 '''from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice'''import sysfrom com.android.monkeyrunner import MonkeyRunner,MonkeyDevice[详细]
-
利用xlrd模块实现Python读取Excel文档
所属栏目:[Python] 日期:2020-12-17 热度:139
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # -*- coding: cp936 -*-#python读取excelimport xlrddef main(): xls=xlrd.open_workbook("d:11.xls") try: mysheet=xls.sheet_by_name("Sheet1")#[详细]
-
基于Python的Android图形锁破解程序
所属栏目:[Python] 日期:2020-12-17 热度:108
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # -*- coding: cp936 -*-import itertoolsimport hashlibimport timeimport os#调用cmd,ADB连接到手机,读取SHA1加密后的字符串os.system("adb pull /[详细]
-
Python 我的第一个程序
所属栏目:[Python] 日期:2020-12-17 热度:123
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 import socketclass HttpClient(object): def __init__ (this,args): this.host = args["host"] this.port = args["port"] this.userAgent = args["us[详细]
-
PyQt实现简单的计算器
所属栏目:[Python] 日期:2020-12-17 热度:195
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #coding=utf-8from __future__ import divisionimport sysfrom PyQt4 import QtGui,QtCore########################################################[详细]
-
使用Python抓取58同城(南京站)的演出票的信息
所属栏目:[Python] 日期:2020-12-17 热度:159
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/env python#-*-coding: utf-8 -*-import reimport urllib2from bs4 import BeautifulSoup as bsimport csvimport osimport sysreload(sys)[详细]
-
tornado实现文件下载的代码
所属栏目:[Python] 日期:2020-12-17 热度:54
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 获取请求参数;请求参数生成json格式,存入文件;下载json文件 class SpockDataIntegrationDownloadHandler(tornado.web.RequestHandler): def post(s[详细]
