python可以调用windows资源吗_如何在Windows上用Python调用WinRar?还有问题吗
使用zipfile模塊,我創(chuàng)建了一個(gè)腳本來提取我的歸檔文件,但是這個(gè)方法會破壞除txt文件之外的所有內(nèi)容。在def unzip(zip):
filelist = []
dumpfold = r'M:\SVN_EReportingZones\eReportingZones\data\input\26012012'
storage = r'M:\SVN_EReportingZones\eReportingZones\data\input\26012012__download_dump'
file = storage + '\\' + zip
unpack = dumpfold + '\\' + str(zip)
print file
try:
time.sleep(1)
country = str(zip[:2])
countrydir = dumpfold + '\\' + country
folderthere = 0
if exists(countrydir):
folderthere = 1
if folderthere == 0:
os.makedirs(countrydir)
zfile = zipfile.ZipFile(file, 'r')
## print zf.namelist()
time.sleep(1)
shapepresent = 0
這里我有一個(gè)問題-通過讀寫壓縮數(shù)據(jù),zipfile命令似乎使它無法被相關(guān)程序使用-我試圖解壓shapefile以在ArcGIS中使用。。。在
^{pr2}$
可以用系統(tǒng)命令調(diào)用WinRar并讓它幫我解包嗎?干杯,亞歷克斯
編輯
使用wb方法后,它適用于我的大多數(shù)文件,但有些文件仍在損壞。當(dāng)我使用winRar手動(dòng)解壓有問題的文件時(shí),它們會正確加載,并且文件大小也會更大。在
有人能告訴我加載winRar的方向嗎?在
總結(jié)
以上是生活随笔為你收集整理的python可以调用windows资源吗_如何在Windows上用Python调用WinRar?还有问题吗的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 傻瓜攻略(十九)——MATLAB实现SV
- 下一篇: python 多个列表_Python同时