【发布时间】:2017-04-11 20:47:30
【问题描述】:
您好,我想创建一个 python 脚本来执行命令行 cmd.exe 并关闭回显并使用下面的命令
unrar.exe -e -w -b compression.rar c:/tmp
notepad.exe 读取文档.txt
然后在这个命令行之后必须关闭命令行,并且必须执行一个普通的python脚本,就是下面这个
os.rename('readdocument.txt','readdocument-done.txt')
import urllib
testfile = urllib.URLopener()
testfile.retrieve("http://randomsite.com/file.gz", "file.gz")
如何正确创建此脚本?
【问题讨论】:
-
如果你有
echo off,为什么还要运行cmd.exe?只在 Python 中一个接一个地运行程序有什么问题?
标签: python shell download rename