python中的中文路径解决:
注:
1、('utf-8')将python默认encode改为utf-8
2、(('utf-8')+"\n")写入时再encode('utf-8')
vi
#!/usr/bin/python
#coding=utf-8
import os
import shutil
import sys
reload(sys)
('utf-8')
dir="/root/python"
for root,dirs,files in (dir):
for f in files:
if f == "":
s = ((root,f))
p = open('/root/python/logs/','a')
(('utf-8')+"\n")
()
c = open('/root/python/logs/','r')
for i in ():
(())
:wq
python