文中python源码 os.system支持变量吗?,pythonos.system,def readHtml


def readHtmlName(dir,filename):    os.system("ls %s' > %s") % (dir,filename)>>> readHtmlName("/root/bet/urls","/root/bet/fileNames.txt")sh: -c: line 0: unexpected EOF while looking for matching `''sh: -c: line 1: syntax error: unexpected end of fileTraceback (most recent call last):  File "<stdin>", line 1, in <module>  File "<stdin>", line 2, in readHtmlNameTypeError: unsupported operand type(s) for %: 'int' and 'tuple'

应该怎么写呢?求指教~

os.system("ls %s > %s" % (dir,filename) )

编橙之家文章,

评论关闭