摘要: 简单的多线程端口扫描工具可以接收IP地址作为参数,如果不接参数,则默认扫描本机的端口 1 #!/usr/bin/python 2 3 import socket 4 import time 5 import argparse 6 import threading 7 8 def arg_proc... 阅读全文
posted @ 2015-06-14 21:44 tmyyss 阅读(407) 评论(0) 推荐(0) 编辑
摘要: 服务器: 1 #!/usr/bin/python 2 #enconding:utf-8 3 import sys 4 import socket 5 import select 6 import time 7 8 HOST='' 9 PORT=2123410 ADDR=(HOST,PORT)11 ... 阅读全文
posted @ 2015-06-11 14:28 tmyyss 阅读(1698) 评论(0) 推荐(0) 编辑
摘要: 服务器程序: 1 #!/usr/bin/python 2 3 import socket 4 5 HOST='' 6 PORT=8008 7 ADDR=(HOST,PORT) 8 BUFSIZ=8096 9 10 SerSock=socket.socket(socket.AF_INET,sock... 阅读全文
posted @ 2015-06-09 18:09 tmyyss 阅读(349) 评论(0) 推荐(0) 编辑
摘要: 这是《Python核心编程(中的文第二版)》的一个习题,题目要求服务器能识别以下命令:ls 返回服务器程序当前目录os 返回服务器操作系统的信息date 得到服务器当前的时间ls dir 返回目录dir的文件列表服务器程序: 1 import time 2 import os 3 import da... 阅读全文
posted @ 2015-06-09 18:03 tmyyss 阅读(268) 评论(0) 推荐(0) 编辑
摘要: 1 # -*- coding: utf-8 -*- 2 3 # Define here the models for your scraped items 4 # 5 # See documentation in: 6 # http://doc.scrapy.org/en/latest/topi... 阅读全文
posted @ 2015-06-05 11:18 tmyyss 阅读(628) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: utf-8 -*-# Define here the models for your scraped items## See documentation in:# http://doc.scrapy.org/en/latest/topics/items.htmlimpor... 阅读全文
posted @ 2015-06-04 15:28 tmyyss 阅读(632) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python#encoding:utf-8#基本思想:#将一个记录插入到已排序好的有序表中,从而得到一个新,记录数增1的有序表。即:先将序列的第1个记录看成是一个有序的子序列,然后从第2个记录逐个进行>插入,直至整个序列有序为止。def sis(alist): l... 阅读全文
posted @ 2015-06-02 11:31 tmyyss 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 字段选项null如果为True,Django将会在数据库中存储空值。默认是False。blank如果为True,这个字段允许为空。默认是False。Choices由两个元素组成的一个可以迭代选择的字段元素。db_index如果为True,那么django-admin.py sqlindex将会生成一... 阅读全文
posted @ 2015-04-09 16:11 tmyyss 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 1、安装bs4我用的ubuntu14.4,直接用apt-get命令就行sudo apt-get install Python-bs42、安装解析器Beautiful Soup支持Python标准库中的HTML解析器,还支持一些第三方的解析器,其中一个是lxml。sudo apt-get instal... 阅读全文
posted @ 2015-04-07 13:55 tmyyss 阅读(15662) 评论(0) 推荐(2) 编辑
摘要: 模型是你的网站数据信息惟一的、明确的来源。它包含你所储存数据的字段定义和行为。一般地,一个模型映射着一个惟一数据库的表单(table)。所有模型都是django.db.models.Model的子类。模型的每个属性代表着一个数据库字段django会自动生成你所需要的数据库使用模型当你定义完你的数据模... 阅读全文
posted @ 2015-04-07 09:39 tmyyss 阅读(385) 评论(0) 推荐(0) 编辑