import time
time 模块相关函数
print(‘tick = %d’%time.time())
print(time.ctime())
print(time.process_time())
print(time.ctime())
字符串拼接
name = ‘tang’ + ‘zhen’ + ‘ye’
print(‘name is %s’%name)
字符串截取
name = “my name is xxx”
print(name[0:5])
字符串 len
name = ‘hello python,sports.status’
print(‘len %d’%len(name))
print(‘len %d’%len(name.encode(“UTF-8”)))
字符串分割 split
list = name.split(‘o’) # 以字符 o 进行分割字符串
print(list)
#字符串合并 join
import os
path_1 = ‘D:\watch_app\watch-apps-in’
path_2 = ‘tools\mkrootfs’
print(os.path.join(path_1,path_2).replace("\","/"))
print(os.path.join(‘demo’,‘exercise’))
print(os.getcwd())