Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 m4a 文件,我想打开它...我该怎么办?我已经尝试了明显的
>>> q = open('file.m4a').read() >>> len(q) 6989886 >>> print q[:10000] >>>
它打印一个空行!我试图用'rb'标志打开文件,但它不起作用。
Python 音频工具?
尝试打印repr()数据:
repr()
>>> print repr(q[:10000])
如果您打印数据本身,它可能包含控制字符或其他不可打印的文本,这会产生误导性输出。Pythonrepr()函数通过根据需要转义字符来使数据可读。
在交互式 shell 中,repr()如果不是 ,则打印输入的表达式的值None。所以这会做同样的事情:
None
>>> q[:10000]