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'
应该怎么写呢?求指教~
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
os.system("ls %s > %s" % (dir,filename) )