为你推荐

php 判断输入是否符合要求

<?php#保留允许的键值if(!function_exists('keep_allow_array')){functionkeep_allow_array($data,$allow_array){if(!is_array($data)||!is_array($allow_array))return$data;f...

MySQL 批量修改某一列的值为另外一个字段的值

 1234567891011mysql> select * from fruit;+----+--------+-------+|id| name   |price|+----+--------+-------+| ...

php xml转数组

functionxml_to_array($Obj){$result=(array)simplexml_load_string($Obj,'SimpleXMLElement',LIBXML_NOCDATA);return$result;} ...
代码星球·2020-09-06

php 数组转字符串 防止json乱码

<?php/****************************************************************使用特定function对数组中所有元素做处理*@paramstring&$array要处理的字符串*@paramstring$function要执行的函数*@ret...

易语言的软件乱码

bate版本内有打对勾  ...

php 生成唯一订单号

/*获取唯一订单号*/functionorder_number($order_header){global$redis;if(trim_all($order_header)!=""){$order_header=trim_all($order_header)."-";}$time=time();$microtime_a...
代码星球·2020-09-06

python3.6 安装

说明:python3.6后安装时自行安装pip,setuptools1.升级的环境信息1.1操作系统: [root@mongodbabin]#cat/etc/redhat-release RedHatEnterpriseLinuxServerrelease6.0(Santiago)1.2Python...
代码星球·2020-09-06

Python正则

  正则表达式—特殊表达式含义正则表达式的字母和数字表示他们自身,但多数字母和数字前加一个反斜杠时会拥有不同的含义。 下面列出了正则表达式模式语法中的特殊元素。 1.普通字符集1)    w   &...
代码星球·2020-09-06

python发送邮件

https://www.jianshu.com/p/cf7241166e33...
代码星球·2020-09-06

python 字典生成sql语句

cols=",".join('`{}`'.format(k)forkini.keys())val_cols=','.join('%({})s'.format(k)forkini.keys())inst='''INSERTINTO`baidu`(%s)VALUES(%s);'''res_sql=inst%(cols,va...

python xpath

importrequestsfromlxmlimportetree#//ul[@id="showImg"]/li/a/img/@srctext=requests.get('yoururl').text#html=etree.HTML(text)#result=etree.tostring(html)#print(res...
代码星球·2020-09-06

Python pip安装Scrapy,报错Twisted

Scrapy依赖的包有如下:lxml:一种高效的XML和HTML解析器w3lib:一种处理URL和网页编码多功能辅助twisted:一个异步网络框架cryptography和pyOpenSSL:处理各种网络级安全需求———————&md...

简单验证码识别

fromPILimportImageimportpytesseractim=Image.open('./1.jpg')imgry=im.convert('L')threshold=140table=[]foriinrange(256):ifi<threshold:table.append(0)else:table...
代码星球·2020-09-06

python 获取 set-cookie

session = requests.session()session.get(r['url'])html_set_cookie = requests.utils.dict_from_cookiejar(session.cookies)print(html_set_cookie)...
代码星球·2020-09-06

python mysqldb 返回字典

MySQLdb默认查询结果都是返回tuple,输出时候不是很方便,必须按照0,1这样读取,无意中在网上找到简单的修改方法,就是传递一个cursors.DictCursor就行。默认程序: importMySQLdb db=MySQLdb.connect(host='localhost',user='...
代码星球·2020-09-06