摘要:
import os os.path.isfile('test.txt') # 如果不存在就返回False os.path.exists(directory) # 如果目录不存在就返回Falseos.makedirs(targetDir) os.path.join(targetDir, fi... 阅读全文
摘要:
生成字符串变量str='python String function' 字符串长度获取:len(str)例:print '%s length=%d' % (str,len(str))连接字符串sStr1 = 'strcat'sStr2 = 'append'sStr1 += sStr2print sS 阅读全文
摘要:
1.格式化输出整数python print也支持参数格式化,与C言的printf似,strHello = "the length of (%s) is %d" %(Hello World,len(Hello World))print strHello#输出果:the length of (Hello... 阅读全文