os关闭MP3文件的问题
直接上代码:>>> import os
>>> os.startfile('1.mp3')
>>> a = os.startfile('1.mp3')
>>> os.close(a)
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
os.close(a)
TypeError: an integer is required (got type NoneType)
如何实现调用系统方法关闭文件 os.startfile() 没有返回值,所以 a 为 None,os.close(None) 是行不通的
页:
[1]