- 博客(22)
- 资源 (4)
- 收藏
- 关注
原创 模拟进度条
import time ,sysfor i in range(20): sys.stdout.write('#') time.sleep(0.1) sys.stdout.flush()
2017-10-30 22:38:41 422
原创 模拟密码管理箱
import sysimport pyperclippwdic={'email':'123456','blog':'654321'}if len(sys.argv)<2: print('用法不正确') exit()account=sys.argv[1]if account in pwdic: pyperclip.copy(pwdic[account])
2017-10-30 22:37:53 213
原创 模拟购物车
模拟用户购物data=dict()salary=4000with open('D:/products.txt','r') as productlsit: #将商品信息显示给用户 for line in productlsit: (k,v)=line.strip('\n').split(':') data[k]=v print('{n
2017-10-30 22:33:34 284
原创 修改商品价格
# @Author Jonathon# @Software: PyCharm Community Edition# @time:2017/10/2915:53import jsonnew_product={}mod_product={}data={}while True: selected=input('add:添加商品,mod:修改价格,q:退出') if sel
2017-10-29 23:20:59 892
翻译 模拟购物车
# @Author Jonathon# @Software: PyCharm Community Edition# @time:2017/10/2816:29products=[{"aaa":"700"},{"bbb":"400"},{"ccc":"200"},{"ddd":"100"}]cart=[]salary = int(input('请输入工资:'))print(produc
2017-10-28 23:39:27 271
原创 Python 猜数字与模拟登陆
猜数字程序:# @Author Jonathon# @Software: PyCharm Community Edition# @time:2017/10/2319:59age=56count=0while count<3: age111 =int(input('age:')) if age111==age: print('you are right'
2017-10-23 23:44:20 262
原创 字符串拼接
name=input('name:')age=input('age:')salary=input('salary:')info1='''---------user info(拼接)------name:'''+name+'''\nage:'''+age+'''\nsalary:'''+salaryinfo2='''----------user info----(占位符)---
2017-10-22 23:16:43 224
转载 Python注释详解
来源:http://www.jb51.net/article/85629.htm注释用于说明代码实现的功能、采用的算法、代码的编写者以及创建和修改的时间等信息。注释是代码的一部分,注释起到了对代码补充说明的作用。Python注释Python单行注释以#开头,单行注释可以作为单独的一行放在被注释的代码行之上,也可以放在语句或者表达式之后。?
2017-10-22 20:17:05 1957 1
原创 Remove Element
Given an array and a value, remove all occurrences of that value in place and return the new length.The order of elements can be changed, and the elements after the new length don't matter.
2017-10-22 01:19:49 250
转载 Displaying multiple records in one row
Displaying multiple records in one row
2017-10-20 16:35:42 220
原创 线程:红绿灯
import threadingimport timeevent=threading.Event()def lighter(): counter=0 while True: if counter>3 and counter<=6: print("\33[1;41;m red") time.sleep(1)
2017-10-20 00:35:43 558
原创 numpy数组基本操作
import numpy as npaaa=np.arange(24).reshape(2,3,4)print(aaa,'\n----------------')print(aaa.sum(axis=0),'\n--------------')#表示全部平面上的对应位置print(aaa.sum(axis=1),'\n-------------')#每一个平面的每一列print(aa
2017-10-19 23:13:50 259
原创 判断字符串是否是回文
class Solution: def isPalindrome(self,ss): if not ss: return True startflag,endflag=0,len(ss)-1 while startflag<endflag: if not ss[startflag].isal
2017-10-19 20:46:05 395 1
原创 Python学习笔记
1、多维数组转置2、a = np.array([[[1, 2, 3],[4, 5, 6],[7, 8, 9]]])b=a.T()TypeError: 'numpy.ndarray' object is not callableT()用法不对3、列表数据类型转换后,dtype显示没变的原因arr = np.array([2.3, 3.2, -1.4, 2.3]) arr.
2017-10-16 19:43:20 334
转载 PMP认证申请流程
PMP认证申请流程是: 1、在PMI网站做PMP英文注册报名 2、在外专局项目管理培训中心网站上做PMP中文注册报名 3、在线支付PMP考试费 4、按照规定时间参加PMP考试
2017-10-16 16:02:12 561
转载 python3中使用map,reduce和filter
python3的map,reduce函数,按照之前python2的方式使用,结果发现结果并不是自己想要的,查询了资料之后才发现原来map,reduce和filter三个函数在python3和python2中发生了较大的差异。
2017-10-15 12:41:39 559
转载 Python lambda介绍
在学习python的过程中,lambda的语法时常会使人感到困惑,lambda是什么,为什么要使用lambda,是不是必须使用lambda?
2017-10-15 12:07:24 210
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人