全称:Print Working Directory用途:显示打印出当前所在工作目录的绝对路径格式:pwd [OPTION] ...Bash内建命令:是说明:pwd打印出来的路径分为两种情况,也正好对应着两个参数"-L , --logical","-P , --physical",这两个参数与Lin...
分类:
系统相关 时间:
2016-01-03 00:24:48
阅读次数:
214
为服务端增加多进程解决方案1、server端代码如下:#!/usr/bin/python#!coding:utf-8import os,sys,timefrom socket import *def handleClient(conn): print '[info] handleClie...
分类:
编程语言 时间:
2016-01-02 16:06:45
阅读次数:
153
在很多编程的书中都会以print“Hello,world!”这样的而一个程序为开始,那么hello,world是什么呢?这就是本章讲解的字符串(也即是一串字符)一、单引号,双引号和转义引号(1)在一般的时候‘Hello,world!’和“Hello,world!”是没有什么区别的,那么为什么会两个都可以用..
分类:
编程语言 时间:
2016-01-02 01:11:02
阅读次数:
345
let charA:Character = "a" switch charA { case "A": print("The letter a") break case "b": print("The ...
分类:
编程语言 时间:
2016-01-02 00:50:19
阅读次数:
202
1. 变量可以指向函数名def f(a): return abs(a)h = f(-10) # 这样是调用函数f且把结果传给变量hprint hh = f # 这是让变量h指向函数f.print h(-10)2. 函数名也是变量def f(a): return abs(a)f = 1f(-10).....
分类:
其他好文 时间:
2016-01-01 18:48:43
阅读次数:
127
if语句:ifelifelse:Python中if语句的一半表现形式:1 if p_1:2 print('is 1')3 elif p_2:4 print('is 2')5 else:6 print('is 3')如果条件满足p_1将会输出is 1,如果条件不满足p_1满足p...
分类:
编程语言 时间:
2016-01-01 15:01:37
阅读次数:
279
1.一个小程序:使用文本编辑器写一个程序:#!/usr/bin/python
#Filename:helloworld.py
print‘HelloWorld!‘执行它:[root@localhost~]#pythonhelloworld.py
HelloWorld!2.考虑一下上个小程序如何工作的?#!/usr/bin/python#组织行,告诉你的系统该使用什么程序来执行这个代码文..
分类:
编程语言 时间:
2015-12-31 21:11:33
阅读次数:
194
1.查看CPU型号[root@cluster134~]#cat/proc/cpuinfo|grepname|awk-F:‘{print$2}‘|uniq
Intel(R)Xeon(R)CPUE5-26200@2.00GHz2.查看物理CPU数量[root@cluster134~]#cat/proc/cpuinfo|grepphysical|sort|uniq
addresssizes:46bitsphysical,48bitsvirtual
physicalid:0
physicalid:..
分类:
系统相关 时间:
2015-12-31 21:07:17
阅读次数:
344
#includeusing namespace std;void Print(int arr[], int length){ for (int i = 0; i a[height]) height--; swap(a[low], a[height]); ...
分类:
编程语言 时间:
2015-12-31 20:53:28
阅读次数:
253
/*关于构造函数对象指针及是否调用构造函数的问题*/#includeusing namespace std;class Date { public: Date(){ ye=1; me=2; de=3;} Date(int y,int m,int d); void print(); private: ...
分类:
其他好文 时间:
2015-12-31 19:24:53
阅读次数:
237