多模块项目Module "*" must not contain source root *. The root already belongs to module "*". 有时候新建了maven工程,然后删了里面的src目录让它成为空的父项目,但是会报下面的错误. Module "*" must not contain source root *. The root already belongs to module "*"
python之对指定目录文件夹的批量重命名 import os,shutil,string dir = "/Users/lee0oo0/Documents/python/test" #指定的目录 for i in os.listdir(dir): #遍历指定目录的文件 newfile = i.replace('a','b') # 替换 oldname = dir +'/'+str(i) newname = dir +'/'+str(newfile) shutil.move(oldnam
Xshell配置ssh登陆远程服务器,找不到 root/.ssh目录,报错信息如下: root@ubuntu:/home/xinxin# cd /root/.ssh/bash: cd: /root/.ssh/: No such file or directory 谷歌(参考原文:http://www.cnblogs.com/zwgblog/p/5838314.html),解决办法: 没有用root用户登录过,执行下ssh操作,就能自动生成, ssh localhost yes 输入passwor
Python操作文件和目录 读写文件比较简单,有一点特别注意就好了 windows下Python默认打开的文件以gbk解码,而一般我们的文件是utf-8编码的,所以如果文本含有中文,就会出现异常或者乱码.此时手动添加encoding='utf-8'表示以utf-8的方式打开. 当然Python写入时候,也是默认以gbk的编码写入.而文件通常是utf-8格式保存的,所以若不指定写入的编码方式,一写入中文就是乱码了 with open('abc.txt', encoding='utf-8') as