摘要: 1 #!/usr/bin/python 2 # -*- coding:utf-8 -*- 3 import os 4 5 print "查看公网IP:" 6 os.system('curl icanhazip.com') 阅读全文
posted @ 2021-01-15 13:56 leejay_python 阅读(64) 评论(0) 推荐(0) 编辑
摘要: 1 #!/usr/bin/python 2 # -*- coding:utf-8 -*- 3 4 import subprocess 5 import datetime 6 7 now_time = datetime.datetime.now().strftime('%Y-%m-%d_%H_%M') 阅读全文
posted @ 2021-01-15 13:53 leejay_python 阅读(453) 评论(0) 推荐(0) 编辑
摘要: 1 #!/usr/bin/python 2 # -*- coding:utf-8 -*- 3 import subprocess 4 import datetime 5 import re 6 import os 7 import tarfile 8 import time 9 import shu 阅读全文
posted @ 2021-01-15 13:25 leejay_python 阅读(198) 评论(0) 推荐(0) 编辑
摘要: import timeimport smtplibimport sysimport osdef sendMailTest(mail_sender, mail_passwd, mail_rcpts, rcpt_host, port): """ : 发信 :param mail_sender: 发件人 阅读全文
posted @ 2019-12-23 09:09 leejay_python 阅读(298) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python import configparser import sys f = configparser.ConfigParser(allow_no_value=True, strict=False) configure_file = sys.argv[1] f.read( 阅读全文
posted @ 2019-12-17 09:22 leejay_python 阅读(1318) 评论(0) 推荐(0) 编辑
摘要: 1、安装dnspython pip install dnspython 2、解析MX、A、TXT、NS代码如下: import dns.resolver def dns_query(domain, type): print(type + "记录:") try: dnsquery = dns.reso 阅读全文
posted @ 2019-12-11 14:13 leejay_python 阅读(1654) 评论(0) 推荐(0) 编辑
摘要: import smtplib from email.mime.text import MIMEText from email.header import Header mail_host = "192.168.213.187" # 设置服务器 mail_user = "admin@leejay.vi 阅读全文
posted @ 2019-12-11 13:28 leejay_python 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 1、添加用户和密码到passwd文件中 cat add_user.py # 将几个用户密码写进passwd文件,用户登陆认证的时候读取此文件 f = open("passwd", "w+", encoding="utf-8") f.write("zhangsan 123456\n") f.write 阅读全文
posted @ 2019-12-10 13:57 leejay_python 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 实现功能: 1、输入父菜单进入到子菜单,以此类推 2、可返回上一层菜单 privince_info = { "河南": { "信阳市": { "商城县": ["双椿铺镇", "河凤桥镇", "三里坪"], "潢川县": ["白店乡", "卜塔集镇"] }, "驻马店": { "确山县": ["李新店 阅读全文
posted @ 2019-12-07 20:41 leejay_python 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 程序功能: 1、启动程序后,让用户输入工资,然后打印商品列表 2、允许用户根据商品编号购买商品 3、用户选择商品后,检测余额是否够,够就直接扣款,不够就提醒 4、可随时退出,退出时,打印已购买商品和余额 your_salary = int(input("Please your salary:")) 阅读全文
posted @ 2019-12-07 10:03 leejay_python 阅读(293) 评论(0) 推荐(0) 编辑