摘要:
import osspam=os.listdir('D:\\shu')j=0spam2=['h','i']for i in spam: os.rename('D:\\shu\\{}'.format(i),'D:\\shu\\{}'.format(spam2[j])) #前面一个参数是要修改的文件夹 阅读全文
摘要:
#利用python完成自动化的任务#遍历文件夹里面的所有的内容--然后打开 利用正则表达式修改文本的内容(re.sub) 然后写入到新的文本内容中import docximport reimport osfilename=os.listdir('D:\\新建文件夹')#获取文件夹里面的所有的文本os 阅读全文
摘要:
import matplotlib.pyplot as plt import numpy as np x=["q","w","e","r","t","y"]#不变的依然是x表示标签值 y=[4,6,7,6,3,9] plt.barh(x,y,align="center",color="green", 阅读全文
摘要:
#画图的基本命令import matplotlib.pyplot as pltimport numpy as npx=np.linspace(0.05,10,1000)y=np.sin(x)plt.plot(x,y,ls='--',lw=2,c='red',label='sin(x)')plt.le 阅读全文
摘要:
import matplotlib as mplimport matplotlib.pyplot as pltx=["a","b","c","d","e","f"]y=[2,3,6,7,9,5,]y1=[5,8,9,3,4,6,]plt.xlim(0,20)plt.barh(x,y,align="c 阅读全文