上一页 1 ··· 5 6 7 8 9 10 下一页
摘要: 1.新建用户 1.新建用户 1.新建用户 登录MYSQL: @>mysql -u root -p @>密码 创建用户: mysql> insert into mysql.user(Host,User,Password) values(‘localhost’,’test’,password(‘1234 阅读全文
posted @ 2016-10-13 15:04 Callum 阅读(284) 评论(0) 推荐(0) 编辑
摘要: 1 字典默认是无序的 2 #name = [1,2,3,4,5,6,7] 3 id_db = { 4 142402189705280916: { 5 6 "name": "liangml", 7 "age": 22, 8 "addr": "heibei" 9 }, 10 14241234705280917... 阅读全文
posted @ 2016-10-12 17:22 Callum 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 1 user='liangml' 2 passwd='liangml' 3 username=input('username:') 4 password=input('password:') 5 #优化前 6 ''' 7 if user == username: 8 print('usernameiscorrect...') 9 if passwd == password: ... 阅读全文
posted @ 2016-10-12 17:21 Callum 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 1.打开文件 例:不加b的情况下输出文件(类型为字符串str形式) 加b的情况下输出的文件(类型为字节的形式bytes) 2.操作文件 3.关闭文件 1.可以通过close来关闭文件 2.可以通过with方式来关闭文件(with可以同时打开多个文件) close方式关闭 with方式来关闭 阅读全文
posted @ 2016-10-12 17:21 Callum 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 1 count = 0 2 while True: 3 print("hello world",count) 4 count +=1 5 if count == 100: 6 print("已暂停") 7 break 8 ------------------------------------------------- 9... 阅读全文
posted @ 2016-10-12 17:11 Callum 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 1 salary = input("Input your salary:") 2 if salary.isdigit(): 3 salary = int(salary) 4 else: 5 exit("Invaild data type") 6 welcome_msg = "Welcome to Liangml shopping mall".center(50,"-"... 阅读全文
posted @ 2016-10-12 17:10 Callum 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 1 Getpass 密文传输模块 2 Os linux系统模块 3 Sys 查看python变量 4 copy 复制 5 6 import getpass 7 username = input('username:') 8 password = getpass.getpass('password:') 9 print(username,pa... 阅读全文
posted @ 2016-10-12 17:09 Callum 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 1 常用:分割、长度、索引、切片 2 r = (1,2,3,4,5)#只读列表元组 3 name = "liangml" 4 strip 5 username = input("user:") 6 if username.strip() == "liangml":#strip可以将输入前后的空格都换掉 7 print("welcome") 8 9 split 10 n... 阅读全文
posted @ 2016-10-12 17:08 Callum 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 1 索引、切片、追加、删除、长度、循环、包含(列表可以随意更改) 2 name = ["minglong", "minglong", jack, 22, age]#定义列表 3 name[1]#查询第一个元素 4 name[-1]#查询最后一个元素 5 name[0:2]#取出0-2的元素 6 name[-5:]#默认包含最后元素 7 name[:6]#取出前5个元素 8 nam... 阅读全文
posted @ 2016-10-12 17:07 Callum 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 1 1.Python优点:简单、优雅、明确 python缺点 2 2.强大的模块三房库 1.代码不能加密 3 3.易移植 ... 阅读全文
posted @ 2016-10-12 17:06 Callum 阅读(266) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 下一页