上一页 1 ··· 54 55 56 57 58
摘要: python模块 __name=='__main__' 用法1.ceshi_mod1.pydef test1(): print('111111')def test2(): print('2222')if __name__ =='__main__': test1()2.ceshi_mod2.py im 阅读全文
posted @ 2017-12-08 08:49 学无边涯 阅读(239) 评论(0) 推荐(0) 编辑
摘要: python 模块和包 简单说相当于命名空间 1,python 模块 python模块就是一个文件,里面有函数,变量等 import 模块 模块.方法 from 模块 import function from 模块 import * __name__ =='__main__' 是判断是自己运行模块还 阅读全文
posted @ 2017-12-07 13:46 学无边涯 阅读(700) 评论(0) 推荐(0) 编辑
摘要: MySQL修改表的语法 增加列[add 列名] ①alter table 表名 add 列名 列类型 列参数【加的列在表的最后面】 例:alter table test add username char(20) not null default ''; alter table test add b 阅读全文
posted @ 2017-12-07 11:38 学无边涯 阅读(2422) 评论(1) 推荐(0) 编辑
摘要: linux mysql 数据库操作导入导出 数据表导出导入 1,数据库导入 mysql -uroot -p show databases; create database newdb; use 数据库; set names utf8; source /home/newdb.sql; 1.1 数据库导 阅读全文
posted @ 2017-12-07 10:47 学无边涯 阅读(7758) 评论(0) 推荐(0) 编辑
摘要: linux php 中session默认file 假如修改为redis php.ini session.save_handler = "files"; session.save_path="tcp://127.0.0.1:6379" /etc/php-fpm.d/*.conf 这个地方也要改 ; S 阅读全文
posted @ 2017-12-05 20:44 学无边涯 阅读(411) 评论(0) 推荐(0) 编辑
摘要: python字符串是不可变类型 所以没有添加和删除操作,更改元素,不会更改元素本身,可以用id(str) 测试,只有从新赋值新的对象才有效果。 阅读全文
posted @ 2017-11-16 20:07 学无边涯 阅读(371) 评论(0) 推荐(0) 编辑
摘要: python字符串的运算有哪些 1,链接符号 + 2,判断字符串是否在某个字符串中 ‘s’ in ‘this’ 返回bool 3,字符串索引 a="this a my" a[0],a[-1],a[1:4],a[1:],a[1:4:2] 阅读全文
posted @ 2017-11-16 20:04 学无边涯 阅读(783) 评论(0) 推荐(0) 编辑
摘要: python字符串中的转义符 1,单引号,双引号,三引号 a='www.96net.com.cn',b="96net.com.cn",c="""96net.com.cn"""" 2.\ 转义字符 、\n 换行符 \t 相当于tab 3.如果不加转义符 a=r"c:window\app\" r相当于 阅读全文
posted @ 2017-11-16 19:47 学无边涯 阅读(8678) 评论(0) 推荐(0) 编辑
摘要: 1.capitalize 第一个单词首字母大写 2.title 每个单词首字母大写 3.upper 每个字母变大写 4.lower 每个字母变小写 5.len() 字符串长度 6.format() 格式化 print("{}".format('aa')) 7.replace替换 str.replac 阅读全文
posted @ 2017-11-16 13:31 学无边涯 阅读(297) 评论(0) 推荐(0) 编辑
上一页 1 ··· 54 55 56 57 58