2017年9月27日
摘要: --安装依赖包 yum -y install compat-libcap1 compat-libstdc++ gcc gcc-c++ glibc-devel libaio-devel libstdc++-devel ksh numactl numactl-devel motif motif-deve 阅读全文
posted @ 2017-09-27 11:36 john2017 阅读(2223) 评论(0) 推荐(0) 编辑
  2017年6月22日
摘要: --原来的不动,添加环境变量(.bash_profile)export JAVA_HOME=/home/public/jdk1.8.0_131export JRE_HOME=$JAVA_HOME/jreexport CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HO 阅读全文
posted @ 2017-06-22 18:32 john2017 阅读(389) 评论(0) 推荐(0) 编辑
  2017年2月6日
摘要: import random x = int(input('Enter a number for x: ')) --随机数最小值y = int(input('Enter a number for y: ')) --随机数最大值 n = int(input('How many numbers do yo 阅读全文
posted @ 2017-02-06 20:24 john2017 阅读(2026) 评论(0) 推荐(0) 编辑
摘要: --raise >>> raise IOError('This is a test!') Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> raise IOError('This is a test! 阅读全文
posted @ 2017-02-06 20:14 john2017 阅读(117) 评论(0) 推荐(0) 编辑
摘要: >>> class Person: def __init__(self, name, age): self.name = name self.age = age def display(self): print(self.name, self.age) >>> p = Person('john', 阅读全文
posted @ 2017-02-06 20:13 john2017 阅读(125) 评论(0) 推荐(0) 编辑
摘要: os.getcwd() 表示当前目录,可以换成其他目录路径 --返回当前目录中的文件夹和文件 >>> import os >>> os.listdir(os.getcwd()) ['01成品代码', '@test.py', 'addtofile1.py', 'class.py', 'class1.p 阅读全文
posted @ 2017-02-06 20:12 john2017 阅读(151) 评论(0) 推荐(0) 编辑
摘要: --设置字符串格式 >>> x = 0.123456789 >>> print('value : %.2f' % x) value : 0.12 >>> >>> x = 0.123456789 >>> y = 0.123456789 >>> print('x = %.2f y = %.3f' % ( 阅读全文
posted @ 2017-02-06 20:11 john2017 阅读(274) 评论(0) 推荐(0) 编辑
摘要: >>> i = 0 >>> while i < 10: print(i) i = i + 1 0 1 2 3 4 5 6 7 8 9 阅读全文
posted @ 2017-02-06 20:08 john2017 阅读(109) 评论(0) 推荐(0) 编辑
摘要: # if.py pwd = input('What is the password? ') if pwd == 'apple': print('Logging on ...') else: print('Incorrect password.') 运行结果: >>> What is the pass 阅读全文
posted @ 2017-02-06 20:07 john2017 阅读(107) 评论(0) 推荐(0) 编辑
摘要: >>> for i in range(5): print(i) 0 1 2 3 4 >>> for i in range(0, 5): print(i) 0 1 2 3 4 >>> for i in range(1, 5): print(i) 1 2 3 4 >>> for i in range(5 阅读全文
posted @ 2017-02-06 20:07 john2017 阅读(86) 评论(0) 推荐(0) 编辑