linux - python调用系统rm命令,无法识别通配符吗?
PHP中文网
PHP中文网 2017-04-18 09:18:30
0
2
358

我想删除目录下所有的*.ts,os.remove无法批量删除

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
伊谢尔伦
>>> args = [ 'rm *.ts' ]
>>> p = subprocess.call(args, shell=True)

参考:

  1. http://stackoverflow.com/ques...

  2. http://stackoverflow.com/ques...

巴扎黑

You may need to write an absolute path

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!