摘要: linux 下安装python3 https://jingyan.baidu.com/article/6b97984dd6dbb01ca2b0bf0a.html linux 下安装mysql https://www.cnblogs.com/xinjing-jingxin/p/8025805.html 阅读全文
posted @ 2018-05-18 20:25 JosephPeng 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 参考http://www.runoob.com/redis/redis-install.html Window 下安装 下载地址:https://github.com/MSOpenTech/redis/releases。 Redis 支持 32 位和 64 位。这个需要根据你系统平台的实际情况选择, 阅读全文
posted @ 2018-05-18 20:24 JosephPeng 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 函数:(方法、功能) 作用:1、提高代码的复用性,2、让代码更简洁 函数命名方法 函数不调用是不会被执行的 def calc(a,b): #形参 #位置参数,必填,否则报错 res = a * b print('%s * %s = %s' %(a,b,res)) calc(7,8) #实参 def 阅读全文
posted @ 2018-05-18 20:22 JosephPeng 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 模块其实就是一个python文件 python导入模块的顺序 1. 从当前目录下找需要导入的python文件 2. 从python的环境变量中找 sys.path 当前目录和sys.path中都有import文件时,优先看当前目录的python文件。 python导入模块的顺序 1. 从当前目录下找 阅读全文
posted @ 2018-05-18 20:22 JosephPeng 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Python 的基本数据包括以下几种: 数字 Python3 支持 int、float、bool、complex(复数)。 在Python 3里,只有一种整数类型 int,表示为长整型,没有 python2 中的 Long。 布尔值 字符型 String 列表 (列表: list / 数组 / ar 阅读全文
posted @ 2018-05-18 20:21 JosephPeng 阅读(741) 评论(0) 推荐(0) 编辑
摘要: 文件打开有3种方式:读模式、写模式、追加模式 f = open('words','r',encoding='utf-8') #打开文件 print(f.read()) #读文件,读取之后文件指针放到最后 print(f.readline()) #读取一行内容 print(f.readlines()) 阅读全文
posted @ 2018-05-18 20:21 JosephPeng 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 一、用 while 循环、for 循环实现 username = joseph,passwd = 123456 让用户输入账号和密码,输入用户和密码输入正确的话,提示你 xxx,欢迎登录,今天的日期是xxx,程序结束 错误的话,提示账号/密码输入错误,最多输入3次,如果输入3次都没有登录成功,提示失 阅读全文
posted @ 2018-05-18 20:20 JosephPeng 阅读(426) 评论(0) 推荐(0) 编辑
摘要: 1. 安装python 从python官方网站:http://www.python.org下载最新版本的python3的安装包。 参考:http://www.cnblogs.com/yaoyaojcy/p/7349019.html 2. 安装pycharm pycharm 安装过程参考:http:/ 阅读全文
posted @ 2018-05-18 20:20 JosephPeng 阅读(125) 评论(0) 推荐(0) 编辑