Mytest_Coding
THE_Gogh
这个作者很懒,什么都没留下…
展开
-
python---------九九乘法表和直角三角形几种不同表达方式
# -*- coding: utf-8 -*-# Author :Gogh# @Time :2017/11/16 20:40# @Email :361910002@qq.com#第一种方法for i in range(1, 10): for j in range(1, 10): print(j,"*", i,"=",i*j,"\t",end="")原创 2017-12-13 14:16:40 · 1697 阅读 · 0 评论 -
python-----------根据企业利润求奖金
# -*- coding: utf-8 -*-# Author :Gogh# @Time :2017/11/14 22:37# @Email :361910002@qq.com"""企业发放的奖金根据利润提成。利润(I)低于或等于10万元时,奖金可提10%;利润高于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的部分,可提成7.5%;20万到40万之间时,高原创 2017-12-13 14:53:29 · 1636 阅读 · 0 评论 -
python-------------三级菜单
# -*- coding: utf-8 -*-# Author :Gogh# @Time :2017/10/31 15:57# @Email :361910002@qq.com# 三级菜单的操作menu = { '北京': { '海淀': { '五道口': { 'soho': {},原创 2017-12-13 14:13:25 · 246 阅读 · 0 评论 -
python-----购物车
# -*- coding: utf-8 -*-# Author :Gogh# @Time :2017/12/12 11:30# @Email :361910002@qq.comproduct_list = [ ('Mac', 9000), ('kindle', 800), ('tesla', 900000), ('python book', 1原创 2017-12-13 14:10:00 · 414 阅读 · 0 评论 -
python-------------------查找文件名包含指定字符串的文件,打印完整路径
# -*- coding: utf-8 -*-# Author :Gogh# @Time :2017/11/14 22:37# @Email :361910002@qq.com# 编写一个search(s)的函数,将当前目录及其所有子目录下# 查找文件名包含指定字符串的文件,打印完整路径import os, logging, pdbdef search(s): root原创 2017-12-13 14:58:59 · 6882 阅读 · 0 评论 -
python---------------求1-100之间的素数
# -*- coding: utf-8 -*-# Author :Gogh# @Time :2017/11/14 22:37# @Email :361910002@qq.com# 求1-100之间的素数import mathdef sunumber(x): if x >= 2: for i in range(2, int(math.sqrt(x)+1)):原创 2017-12-13 14:49:44 · 4858 阅读 · 0 评论 -
python-------------自定义str转换成int的函数
# -*- coding: utf-8 -*-# Author :Gogh# @Time :2017/12/7 15:39# @Email :361910002@qq.comdef str2int(s): def fn(x, y): return x * 10 + y def char(s): return {'0': 0, '1': 1,原创 2017-12-13 14:45:04 · 1506 阅读 · 0 评论 -
python--------------发送邮件
# -*- coding: utf-8 -*-# Author :Gogh# @Time :2017/11/28 16:56# @Email :361910002@qq.comfrom email import encodersfrom email.header import Headerfrom email.mime.text import MIMETextfrom email原创 2017-12-13 14:39:12 · 376 阅读 · 0 评论 -
python-----------------用户登陆
# -*- coding: utf-8 -*-# Author :Gogh# @Time :2017/11/16 21:22# @Email :361910002@qq.com# 输入用户名和密码,认证成功后显示欢迎信息,输错三次后锁定count = 0 # 计数器username = "admin" # 登录用户名userpassword = "admin" # 登录密码原创 2017-12-13 14:25:41 · 364 阅读 · 0 评论 -
python----------------正则实现计算器功能
# -*- coding: utf-8 -*-# Author :Gogh# @Time :2017/12/4 20:16# @Email :361910002@qq.comimport redef operator_update(formula): # 对formula公式进行 去除空字符,更新运算符处理 formula = formula.replace(" ",原创 2017-12-13 14:22:37 · 408 阅读 · 0 评论 -
soket实现远程执行系统命令
server# -*- coding: utf-8 -*-# @author: Gogh# date: 2017/12/20 22:12# @Email:361910002@qq.comimport socket,subprocessip_port = ('127.0.0.1', 8000)sk = socket.socket()sk.bind(ip_port)sk.lis原创 2017-12-22 17:22:15 · 500 阅读 · 0 评论