- 博客(18)
- 资源 (3)
- 收藏
- 关注
原创 layui.open 传值
场景:在文章编辑页面中点击插入图片按钮,弹出新窗口,完成选择后再获取选定的图片主窗口:{extend name="base/base" /}{block name="main"}<form id="form" method="post" class="layui-form layui-form-pane" action="{:url('/admin/article_chan...
2019-09-20 23:20:47
4234
翻译 python———栏目排序
l = [ {'category_name': '我是第一级', 'id': 8, 'parent_id': 0, 'update_time': None, 'create_time': None}, {'category_name': '2222', 'id': 2, 'parent_id': 3, 'update_time': None, 'create_time': Non...
2019-08-16 15:18:32
197
原创 python————集合
# list_1 = [1,4,5,7,3,6,7]# list_1 = set(list_1)# list_2 = set([2,6,0,66,22,8,4,9])# print("交集:",list_1.intersection(list_2))#交集# list_3 = list_1.union(list_2)#并集# print("并集:",list_3)# list_...
2018-07-25 16:22:18
187
转载 python——字典操作
#coding=UTF-8d={'name':'Tom','age':'22'}#字典操作之:增d={'name':'Tom','age':'22'}d['sex'] = 'man'print d#字典操作之:删 pop()'''通过指定的key值,删除字典的一个键值对返回被删除的key对应的value'''d={'name':'Tom','age':'22'}print...
2018-07-24 19:57:47
305
转载 python 字符串操作
字符串的常用操作包括但不限于以下操作:字符串的替换、删除、截取、复制、连接、比较、查找、分割等这里将对字符串的内置操作方法进行总结归纳,重点是以示例的方式进行展示。使用type获取创建对象的类 type(name)使用dir获取类的成员dir(name)使用vars获取类的成员和各个成员的值capitalize 功能:字符串首字母大写 name = 's...
2018-07-24 19:15:27
174
原创 第二周作业,模拟购物
product_list = [ ('Iphone',5800), ('Mac Pro',9800), ('Bike',800), ('Watch',10600), ('Coffee',31), ('Alex Python',120),]shopping_list = []salary = input("请输入你的工资:")if sala...
2018-07-24 17:04:17
210
原创 Python学习之——列表
#import copy #copy模块,用于深拷贝,names = ["Zhangyang", "Guyun", "Xiangpeng", "Xuliangchen"]name2 = ['Zhangsan', 'Lisi', 'Wangwu']#names.append("Gusu") #追加#names.insert(1,"Chenronghua")#在指定位置后边插入
2018-07-23 16:57:32
144
原创 python学习笔记——流程控制
count = 0 #计数器while True: #读取锁定用户 l = open("D:/Python/study/task/1/lock") lock_name = l.readline() l.close() #判断输入用户是否被锁定 name = input('请输入登陆名:') if name == lock_name: ...
2018-07-22 17:12:35
199
原创 PHP单例模式的继承
基类:本例在TP5框架下实现<?php/** * User: epsds@qq.com * Date: 2018/5/30 * Time: 18:38 */namespace app\admin\logic;use think\Controller;abstract class Base extends Controller { private static $...
2018-06-01 10:19:45
779
原创 OpenResty 编译安装
1、下载:https://openresty.org/download/openresty-1.13.6.1.tar.gz tar -zxvf openresty-1.13.6.1.tar.gz查看安装了解参数配置帮助文件:http://openresty.org/cn/installation.html找到对应的系统,我本地使用centos7所以选择了Fedora 和 RedHat 用户安装所...
2018-03-15 16:53:35
995
原创 centos7 swoole安装笔记
1:获取swoolehttps://github.com/swoole/swoole-src/releaseshttp://pecl.php.net/package/swoolehttp://git.oschina.net/swoole/swoole2:解包并用phpize编译扩展/usr/local/webserver/php7/bin/phpize红色字体部分是
2017-06-30 11:27:37
2642
原创 MacBook:phpmyadmin [2002] No such file or directory修复
输入在浏览器中输入 网址,填入用户名密码却提示 [2002] No such file or directory 。在网上找了一圈,似乎是 mysql.sock 的位置不对。首先打开终端,找到 mysql.sock 的位置find / -name mysql.sock结果如下:find: /dev/fd/3: Not a directoryfind: /dev/fd/4:
2017-06-30 09:47:06
731
原创 centos7下iptables防火墙的使用
CentOS 7.X默认使用的是firewall作为防火墙,至于好不好我也不知道,我只知道我是新手,看到命令行一脸的萌哒哒。1、关闭firewall:systemctl stop firewalld.servicesystemctl disable firewalld.servicesystemctl mask firewalld.service2、安装iptables防火
2017-06-30 09:38:28
250
原创 centos7简易启动脚本制作
首先声明,网上有很多现成的启动脚本,可以去复制一下就好,我拿自己编写的redis启动脚本来做个返利1:进入/etc/init.d/目录2:创建启动脚本(vim redis)3:将以下代码黏贴到文件中#!/bin/sh#add for chkconfig#chkconfig: 2345 80 90#description: the description of the
2017-06-30 09:31:25
1229
原创 centos7 redis、php扩展编译与安装
1:下载redis包 wget http://download.redis.io/releases/redis-3.2.9.tar.gz2:解包 tar zxvf redis-3.2.9.tar.gz3:编译 make4:安装 make PREFIX=/usr/local/webserver/redis install (红色字体部
2017-06-30 09:24:09
214
原创 centos7 PHP7 编译、安装
#########PHP7编译./configure \--prefix=/usr/local/webserver/php7 \ #这里可以修改为你的php7安装目录--with-apxs2=/usr/local/webserver/apache/bin/apxs \ #这里是apache的--with-bz2 \--with-curl \--with-gd
2017-06-30 09:22:31
318
原创 centos7 编译安装mysql
第一步:安装所需扩展第二步:卸载mariadb,具体方法自行百度,这里就不浪费空间了。第三步:编译安装,用cmake进行编译,如果没有安装cmake。可以直接 yum install cmake,如果想自己编译安装可以自行百度。
2017-06-30 09:19:16
293
原创 centos7 Apache编译、安装
####下载 wget http://apache.fayea.com/httpd/httpd-2.4.26.tar.gz####解包 tar zxvf httpd-2.4.26.tar.gz###编译./configure --prefix=/usr/local/webserver/apache--with-apr=/usr/local/
2017-06-30 09:17:12
957
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人