- python字符串格式化两种方式:(深入研究,东西还很多)
>>> 'Hello, %s' % 'world'
'Hello, world'
>>> 'Hi, %s, you have $%d.' % ('Michael', 1000000)
'Hi, Michael, you have $1000000.'
In [1]: '{0},{1}'.format('kzc',18)
Out[1]: 'kzc,18'
In [2]: '{},{}'.format('kzc',18)
Out[2]: 'kzc,18'
In [3]: '{1},{0},{1}'.format('kzc',18)
Out[3]: '18,kzc,18'
- urllib.request.urlretrieve()用法
urllib.request.urlretrieve(url, filename=None, reporthook=None, data=None)
- os模块和sys模块
os.path.join("D:\","test.txt") #只是连接作用,不写不会主动创建
os.mkdir(os.path.join("D:\","test.txt"))
os.system("mkdir Test.txt") #在程序中引用命令行命令
os.getcmd()#获取当前路径