sys.exit(exit_code) 退出程序 sys.modules 是一个dictionary,表示系统中所有可用的module sys.platform 得到运行的操作系统环境 sys.path 是一个list,指明所有查找module,package的路径. 1. os.environ 一个dictionary 包含环境变量的映射关系 os.environ["HOME"] 可以得到环境变量HOME的值 2. os.chdir(dir) 改...
str1 = 'hello javatpoint' #string str1 str2 = 'how are you' #string str2 print (str1[0:2]) #printing first two character using slice operator print (str1[4]) #printing 4th character of the string print (str1*2) #printing the string twice print (str1 + str2) #printing the ...