mpwrapper.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:jessy 作者: jessy-project 项目源码 文件源码
def play(self):
        if self._process is None:
            if self.station:
                fifo_path = self._create_fifo()
                if fifo_path:
                    self._process = subprocess.Popen(self._cmd.format(fifo=fifo_path, url=self.station),
                                                     stdin=subprocess.PIPE,
                                                     stdout=open('/dev/null', 'w'),
                                                     stderr=open('/dev/null', 'w'),
                                                     shell=True, preexec_fn=os.setsid)
                    if self._is_running():
                        self._volume = 100
            else:
                print "Error: no station selected"
        else:
            print "Error: Already playing"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号