8 云空

尚未进行身份认证

暂无相关简介

等级
TA的排名 5w+

Python资源大全

Python资源Python 3.7.4 文档:https://docs.python.org/zh-cn/3.7/ 快速安装模块:pip3 install PyQt5 -i https://pypi.tuna.tsinghua.edu.cn/simple python开源项目及示例代码:https://www.cnblogs.com/dpf-learn/p/8053043....

2018-12-25 14:04:12

基础数据API服务

聚合数据提供30大类,160种以上基础数据API服务手机号码归属地API接口:https://www.juhe.cn/docs/api/id/11历史上的今天API接口:https://www.juhe.cn/docs/api/id/63股票数据API接口:https://www.juhe.cn/docs/api/id/21全国WIFI接口:https://www....

2020-03-01 11:14:51

新浪图片爬虫

'''新浪图片爬虫 by 郑瑞国'''import urllib.requestimport chardetimport repage = urllib.request.urlopen('http://photo.sina.com.cn/') #打开网页htmlCode = page.read() ...

2020-02-25 12:20:21

Python 单主机,单线程,windows系统,判断主机IP是否存活

'''Python 单主机,单线程,windows系统,判断主机IP是否存活 by 郑瑞国'''import osdef ping_ip(ip): output = os.popen('ping -n 1 %s'%ip).readlines() for w in output: if w.find('TTL')>=0: pr...

2019-12-25 10:03:57

Python 列表去重

'''Python 列表去重 by 郑瑞国'''list=[2,3,4,4,5,6,7,7,8,9,8]for x in list: if list.count(x)>1: list.remove(x)print(list)'''Python 列表去重 by 郑瑞国'''list = [2,3,4,4,5,6,7,7,8,9,8]list1 ...

2019-12-25 09:55:33

Python 字符串读写

'''Python 字符串读写 演示 by 郑瑞国'''data = '''天行健,君子以自强不息,\n地势坤,君子以厚德载物'''f = open('test.txt','w')f.write(str(data))f.close()f = open('test.txt','r')data2 = f.read()print(data2)...

2019-12-25 09:47:51

Python 剪刀石头布

'''Python 剪刀石头布 by 郑瑞国'''import randommydict = {0:'剪刀',1:'石头',2:'布'}while True: #提示获取玩家的输入 player = int(input('请输入 0剪刀 1石头 2布:')) #让电脑随机出一个 computer = random.randint(0,2) pr...

2019-12-23 09:35:45

Python global 演示

'''Python global 演示 by 郑瑞国'''a = 8b = 9def aaa(): global a #全局变量a a=88 print('函数aaa内全局变量:',a) def bbb(): b=99 #局部变量b print('函数bbb内局部变量:',b) def abc():...

2019-12-20 09:56:54

Python 端口扫描 演示

''' Python 端口扫描 by 郑瑞国1、引用 socket模块2、IP3、端口4、connect()5、调用'''import socketIP = input('IP:')Port = input('Port:')for port in range(int(Port)): try: s=socket.socket() s.c...

2019-12-18 12:06:48

Pyhon 调试模块pysnooper用法演示

'''Pyhon 调试模块pysnooper用法演示 by 郑瑞国'''import pysnoopery = 0@pysnooper.snoop()def abc(): global y for x in range(101): y = y+x print(y) print(y)abc()...

2019-12-16 17:09:40

Python3 sqlite3 数据库增删改查演示

'''Python3 sqlite3 数据库增删改查演示 by 郑瑞国'''import sqlite3conn = sqlite3.connect('test6.db')print ("Opened database successfully")c = conn.cursor()try: #创建数据库表 c.execute('''CREATE TABLE C...

2019-12-09 15:48:35

Python 扑克牌游戏_发牌

'''Python 扑克牌游戏_发牌 by 郑瑞国'''import randompoker=[x for x in range(1,55)]player={}for p in range(1,4): player[p]=[]pokers={}#print(poker) types = ['红桃','方片','黑花','黑桃']num = [y for y in ...

2019-12-05 21:56:57

Python 抽扑克牌游戏

'''Python 抽扑克牌游戏 by 郑瑞国'''import randompuke=[x for x in range(1,55)]pukes={}#print(puke)types = ['红桃','方片','黑花','黑桃']num = [y for y in range(1,14)]i=1for t in types: for n in num: ...

2019-12-05 16:37:39

Python 模拟密码登录

'''Python 模拟密码登录 by 郑瑞国'''i = 0while i < 3: i += 1 username = input("username:") password = input("password:") if (username == 'safeness' or username == 'health') and password ...

2019-12-04 16:30:42

Python 数字筛选

'''Python 数字筛选 by 郑瑞国'''a = [11,22,33,44,55,66,77,88,99]value1 = []value2 = []dict1= {1:value1,2:value2}for I in a: if I>66: value1.append(I) elif I<66: value2.ap...

2019-12-04 16:29:05

python 闹钟

'''python 闹钟 by 郑瑞国'''import sysimport timefrom PyQt5.QtCore import *from PyQt5.QtGui import *from PyQt5.QtWidgets import *message = input('提示信息:')if not message: message = '该上课了'setTi...

2019-11-28 15:40:55

Python 字典存储为文件并读取

'''Python 字典存储为文件并读取 by 郑瑞国'''data = {1:'a',2:'b',3:'c'}f = open('data.txt','w')f.write(str(data))f.close()f = open('data.txt','r')data2 = f.read()data3 = eval(data2)print(data3)...

2019-11-22 23:44:32

Python 海陆空三栖战车(类演示)

'''海陆空三栖战车(类演示) by 郑瑞国'''class Car(object): def __init__(self,color): self.color=color self.len = 10 self.w = 2 self.speed = 0 def stop(self): ...

2019-11-21 14:22:14

Python 标点符号查找替换

'''Python 标点符号查找替换 by 郑瑞国'''file1 = open(r'd:\drivers\gmreadme.txt', 'r')text = file1.read()file1.close()temp = text.replace('.','。',text.count('.'))file2 = open(r'd:\drivers\gmreadme.txt', 'w...

2019-11-20 17:14:33

Python 字符串查找替换

'''在自己的电脑上的任意目录下,创建一个文本文档。要求:(1)利用open()函数打开的文件对象的write()方法写入: (内容是:我要将编程学好,编程会让我走向成功。) (2)写入后利用字符串的replace方法将“编程”替换为“python”'''Temp = ‘我要将编程学好,编程会让我走向成功。’file2 = open(r'd:\driver...

2019-11-20 17:10:22

查看更多

勋章 我的勋章
  • 持之以恒
    持之以恒
    授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!
  • 勤写标兵Lv2
    勤写标兵Lv2
    授予每个自然周发布4篇到6篇原创IT博文的用户。本勋章将于次周周三上午根据用户上周的博文发布情况由系统自动颁发。