码迷,mamicode.com
首页 >  
搜索关键字:print    ( 43532个结果
python handle exception
1. handle exceptionimport systry: a=1/1except Exception, e: print "failed", sys.exc_info()[0]else: print "no exception"finally: print "e...
分类:编程语言   时间:2014-09-18 13:09:03    阅读次数:174
Eclipse设置打印线
在调出Preferences之后,选中Text Editors,先选中Show print margin,在Print margin column框中填入180即可,然后选择下面的Print margin,点击右边的color,可以变更颜色,将其改成鲜艳的红色即可。...
分类:系统相关   时间:2014-09-17 21:55:32    阅读次数:328
python——dict详解
python3.0以上,print函数应为print(),不存在dict.iteritems()这个函数。在python中写中文注释会报错,这时只要在头部加上# coding=gbk即可#字典的添加、删除、修改操作dict = {"a" : "apple", "b" : "banana", "g" ...
分类:编程语言   时间:2014-09-17 20:14:52    阅读次数:389
Haskell练习
题目链接1 -- Enter your code here. Read input from STDIN. Print output to STDOUT2 import Data.List3 main = do4 inputdata f (head xs) (length xs)) . g...
分类:其他好文   时间:2014-09-17 20:06:42    阅读次数:254
Ubuntu监控load脚本
Ubuntu监控load脚本:#viload.sh按a或i进入编辑模式#!/bin/bashName=`hostname`IP=`/sbin/ifconfigeth0|grep"inetaddr"|awk-F[:""]+‘{print$4}‘`Date=`date+%m%d%y`Load=`/usr/bin/uptime|grepload|awk-F[:""]+‘{print$14}‘|tr-d","`Load2=150if[$(echo"$Load>$Load2"|bc)-e..
分类:其他好文   时间:2014-09-17 18:51:43    阅读次数:224
binlog日志增量备份
#!/bin/bash loglast=`cat/var/lib/mysql/localhost-bin.index|awk-F"/"‘{print$2}‘|tail-n1`//取出正在使用binlog日志 if[!-e/binlogdir];then mkdir/binlogdir fi foriin`cat/var/lib/mysql/localhost-bin.index|awk-F"/"‘{print$2}‘`//遍历所有的binlog日志 do logna..
分类:其他好文   时间:2014-09-17 18:51:23    阅读次数:252
snprintf/_snprintf 在不同平台间函数差异
原文是以MSDN的文档介绍为主。而且还是之前的版本。不知新版本有没有改变,一会儿安装好了VS2013 Express试试看。 这个函数最主要的问题是C标准中没有定义,是各个厂家自己提供的,gcc提供的就是snprintf,ms提供...
分类:其他好文   时间:2014-09-17 15:43:22    阅读次数:265
PHP:Cannot modify header information - headers already sent by出错解决
ob_start();setcookie("username","test",time()+3600);echo "the username is:".$HTTP_COOKIE_VARS["username"]."\n";echo "the username is:".$_COOKIE["username"]."\n";print_r($_COOKIE);?>访问该PHP文件时提示Warning:...
分类:Web程序   时间:2014-09-17 13:40:52    阅读次数:229
今天学习打瞌睡 哎,写的都不是代码。估计电脑会因为我写的死机了
#include void main(){int max=0,num1=0,z=0;printf("请输入一个数;");scanf("%d",&max);while (max){num1=max%10;printf("%d",num1);max=max/10;printf("%d",num1);} ...
分类:其他好文   时间:2014-09-16 23:36:31    阅读次数:208
常用的脚本
(一)利用awk提取某些列 处理如下的数据 INFO 2014-09-15 01:00:42 0.0.0.0 [a: 81, b: 55] {[CLI]} awk -F ' ||,|]' '{print $6 , $9, $12}' raw_data > value_data (二)利用awk统计某些字串出现的次数 可以直接用awk命令行 awk 'BEGIN {num...
分类:其他好文   时间:2014-09-16 22:07:11    阅读次数:226
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!