代码改变世界

python 判断字符串是否包含子字符串

2017-03-09 11:09 by 丨o聽乄雨o丨, 110890 阅读, 2 推荐, 收藏, 编辑
摘要:第一种方法:in string = 'helloworld' if 'world' in string: print 'Exist' else: print 'Not exist' 第二种方法:find string = 'helloworld' if string.find(’world‘) == 阅读全文

python assert用法

2017-03-09 10:41 by 丨o聽乄雨o丨, 813 阅读, 0 推荐, 收藏, 编辑
摘要:assert的异常参数,其实就是在断言表达式后添加字符串信息,用来解释断言并更好的知道是哪里出了问题。 格式如下:assert expression [, arguments]assert 表达式 [, 参数] 举个例子: string = 'helloworld' assert 'world' i 阅读全文

centos make error: fatal error: curses.h: No such file or directory

2017-02-22 09:07 by 丨o聽乄雨o丨, 416 阅读, 0 推荐, 收藏, 编辑
摘要:yum install ncurses.x86_64 yum install ncurses-devel.x86_64 yum install ncurses-libs.x86_64 yum install ncurses-static.x86_64 阅读全文

centos7安装mysql5.6

2017-02-21 11:08 by 丨o聽乄雨o丨, 263 阅读, 0 推荐, 收藏, 编辑
摘要:1. 卸载akonadi-mysql,因为这个会和mysql冲突; rpm -qa | grep mysql 显示已安装的mysql包 rpm -e akonadi-mysql-1.9.2-4.el7.x86_64 删除akonadi-mysql 2.安装mysql-community,因为cent 阅读全文

Thinkstation center M8600t装RHEL7不能联网,网卡驱动没装问题

2016-12-21 20:53 by 丨o聽乄雨o丨, 2482 阅读, 0 推荐, 收藏, 编辑
摘要:Thinkstation center M8600t装RHEL7时不能联网,配置ip也不可以,后来发现网卡驱动没有安装。可以通过装网卡驱动的方式解决问题,解决方法如下: root登录 lspci | grep 'Ethernet controller' #查看网卡型号 显示:Ethernet con 阅读全文

gedit 没有preference项,使preference回归,并用命令行设置行号,解决centos7下中文乱码,text wrapping等问题

2016-12-09 20:43 by 丨o聽乄雨o丨, 863 阅读, 0 推荐, 收藏, 编辑
摘要:1. 最简单的,使preference选项回来: 2. 设置行号: 3. 当前行高亮: 4. 解决centos7 gedit中文乱码的问题: 阅读全文

linux rhel7 dock6.7安装

2016-12-09 20:13 by 丨o聽乄雨o丨, 409 阅读, 0 推荐, 收藏, 编辑
摘要:1. 下载dock6.7 先申请license 在这个网址下载http://dock.compbio.ucsf.edu/Online_Licensing/index.htm 2. tar zxvf *.tar.gz 3. cd dock6/install 4. ./configure gnu 5. 阅读全文

rhel 7.0, windows10双系统grub2设置

2016-12-09 15:59 by 丨o聽乄雨o丨, 1549 阅读, 0 推荐, 收藏, 编辑
摘要:因为在win10基础上装了rhel7,但是启动时却没有win10的启动项,下面的方法解决此问题。 $ su #root登录 $ cd /boot/grub2 1. 简单执行grub2-mkconfig -o grub.cfg,自动检测磁盘中安装的系统截止 $ grub2-mkconfig -o gr 阅读全文

编译错误:/usr/bin/ld: cannot find -lz

2016-12-09 12:03 by 丨o聽乄雨o丨, 217 阅读, 0 推荐, 收藏, 编辑
摘要:编译时出现错误/usr/bin/ld: cannot find -lz,安装zlib和zlib-devel yum install zlib yum install zlib-devel 阅读全文

rhel 7.0 配置centos yum源(2016/12/8),成功!

2016-12-08 19:43 by 丨o聽乄雨o丨, 2348 阅读, 0 推荐, 收藏, 编辑
摘要:1.首先查看redhat 7.0系统本身所安装的那些yum 软件包: rpm -qa | grep yum #列出所有已安装的yum包 2.删除这些包: rpm -e *.rpm --nodeps #删除所有以前的yum包 3.下载新的yum rpm包:(2016/12/8 最新版本rpm,如果40 阅读全文