随笔分类 - python
摘要:<!DOCTYPE html> <html> <head> <title></title> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <style> p { text-align: left; padding
阅读全文
摘要:import socket def main(): client=socket.socket() client.connect(("127.0.0.1",8081)) while True: inputs=input(">>>").strip() client.send(len(inputs).to
阅读全文
摘要:#!/usr/bin/env python#-*- coding:utf-8 -*-# author:leo# datetime:2020/3/17 9:16# software: PyCharm#闭包def outer(): a=12 def inner(): print(a) return 1
阅读全文
摘要:一、linux 下磁盘的表示方式 /dev/sda1 /dev 设备文件目录 sd : 表示sata,sas,usb,scsi 接口的硬盘 a: linux 用字母表是第几磁盘,a代表第一块 1:linux 用数字表示某块磁盘的第几分区 二、磁盘使用 磁盘初始化-》磁盘分区:一个磁盘只能分4个区,主
阅读全文
摘要:import threading,time import random def door(nums): num=1#电梯在一楼 while True: print("this door is %s 楼"%num) if num==nums: fangxiang=True elif num==1: ...
阅读全文
摘要:#!/usr/bin/env python #-*- coding:utf-8 -*- # datetime:2019/5/22 14:20 # software: PyCharm #服务端 import socket import os post=('192.168.222.131',9090)#设置端口和 socket_obj=socket.socket() socket_obj.bind(...
阅读全文
摘要:class WeatherPipeline(object): def process_item(self, item, spider): print(item) return item #插入到redis import redis import json class RedisPipeline(object): def __init__(self...
阅读全文
摘要:1 #!/usr/bin/env python 2 #-*- coding:utf-8 -*- 3 # author:leo 4 # datetime:2019/4/24 16:26 5 # software: PyCharm 6 import redis 7 #链接服务器 8 config={"host":"127.0.0.1","port":6379,'password':'...
阅读全文
摘要:#!/usr/bin/env python #-*- coding:utf-8 -*- # author:leo # datetime:2019/4/24 15:22 # software: PyCharm #pymysql 数据库操作 import pymysql #配置信息 config={"h
阅读全文