功能:查询当前所在目录位置print working directorypwd[root@localhost /]# cd ./home/test/[root@localhost test]# pwd/home/test[root@localhost test]#
分类:
系统相关 时间:
2015-09-05 22:01:16
阅读次数:
163
>>> a='bbc'>>> a'bbc'>>> print abbcstr()一般是将数值转成字符串;repr()是将一个对象转成字符串显示,注意只是显示用,有些对象转成字符串没有直接的意思。print 语句调用 str()函数显示对象,而交互式解释器则调用 repr()函数来显示对象。
分类:
其他好文 时间:
2015-09-05 16:16:47
阅读次数:
230
1.语句是逐行执行的,除非你不是这么编写
如果语句中使用if语句,他的执行是跳跃的,if语句是流程控制
>>> def test():
print(1)
print(2)
print(3)
print(4)
>>> test()
1
2
3
4
>>> def testIf(param):
if param<1:
print("输入的数字小于1"...
分类:
编程语言 时间:
2015-09-05 12:34:04
阅读次数:
218
package com.leegh.parameterization/** * @author Guohui Li */class Structural { def open() = print("A class instance Opened") }object Structural_Type {...
分类:
其他好文 时间:
2015-09-05 09:48:37
阅读次数:
177
range()是列表, xrange()是迭代>>> a = ['Mary', 'had', 'a', 'little', 'lamb']>>> for i in range(len(a)):... print i, a[i]...0 Mary1 had2 a3 little4 lamb然而...
分类:
编程语言 时间:
2015-09-05 06:35:29
阅读次数:
189
以下操作均可在$HIVE_HOME/bin/.hiverc文件中保存,设置为默认参数set hive.mapred.mode=strict;//开启strict模式,以下情况报错:(1)没有limit限制的order by语句.(2)动态分区插入set hive.cli.print.current....
分类:
其他好文 时间:
2015-09-04 12:32:17
阅读次数:
167
一、定义 require,require_once,include,include_once都属于PHP的关键字,也就是说它们实际都是PHP的语句,而不是函数,类似于print,echo一样,也是PHP种的输出语句,而不是函数。但在更多的时候,大家都常称作函数。二、用法 require 'tes.....
分类:
其他好文 时间:
2015-09-04 12:30:58
阅读次数:
108
在使用Python的过程中,想输入账号和密码,但是密码会随着输入显示在屏幕上,为了解决这个问题需要用到msvcrt模块这里是使用代码import msvcrt, sysdef pwd_input(a): print str(a), chars = [] while True: ...
分类:
编程语言 时间:
2015-09-03 23:09:48
阅读次数:
223
1 def f(x): 2 return x*x 3 print map(f,[1,2,3,4,5]) 4 5 [1, 4, 9, 16, 25] 6 7 def format_names(s): 8 return s[0].upper()+s[1:].lower() 9 pr...
分类:
编程语言 时间:
2015-09-03 21:33:13
阅读次数:
180
cat?user6.csv|awk?‘BEGIN{FS=",";OFS="|"}{print?$1,$2}‘>user_consu6.csv
cat?consu6.csv|awk?‘BEGIN{FS="|";OFS="|"}{if(length($2)<=5)?print?$0}‘>user_consu6.csv
?sed?‘s/\./|/g‘?user_cons...
分类:
其他好文 时间:
2015-09-03 20:28:59
阅读次数:
205