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 file
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in readHtmlName
TypeError: unsupported operand type(s) for %: 'int' and 'tuple'
应该怎么写呢?求指教~
os.system("ls %s > %s" % (dir,filename) )