music.py 文件源码

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

项目:Jarvis 作者: sukeesh 项目源码 文件源码
def play(data):
    if len(data) == 0:
        print(Fore.BLUE + "Song name doesn't exist. (play '"'song name'"') " + Fore.RESET)

    else:
        wanted = data
        find = os.popen("ls | grep -i " + '"' + wanted + '"')
        music = str(find.readline())

        if not music:
            os.system("instantmusic -s " + wanted + " 2> /dev/null")
            find = os.popen("ls -tc --hide='__*' --hide='*.py'")
            music = str(find.readline()).replace("\n", "")
            os.system("XDG_CURRENT_DESKTOP= DESKTOP_SESSION= xdg-open " +
                      music.replace(" ", "\ ").replace(" (", " \("). replace(")", "\)") +
                      " 2> /dev/null")

        else:
            os.system("XDG_CURRENT_DESKTOP= DESKTOP_SESSION= xdg-open " +
                      music.replace(" ", "\ ").replace(" (", " \("). replace(")", "\)") +
                      " 2> /dev/null")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号