我将歌曲名称传递给某个功能,并且无法为omxplayer构建路径
def PlayMusic(song):
#check if the process exists
is_pid = subprocess.call("pidof omxplayer.bin > /dev/null", shell=True)
if is_pid == 0:
return musicplaying("Song already Playing")
else:
pathsong ='/home/pi/'+song
os.system('omxplayer --no-keys -o local pathsong &')
return musicplaying (song +" playing")
我如何把'途径'进入omxplayer命令行?
答案 0 :(得分:0)
这就是我想要的
<!DOCTYPE html>
<html>
<head>
<title><?php echo get_bloginfo( 'name' ); ?> - <?php bloginfo('description'); ?></title>
<link rel="stylesheet" type="text/css" href="<?= get_template_directory_uri(); ?>/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="<?= get_template_directory_uri(); ?>/css/style.css">
</head>
<body>
<nav class="navbar navbar-default navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid" id="navfluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navigationbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<?php echo get_home_url() ?>"><?php echo get_bloginfo( 'name' ); ?></a>
</div>
<div class="collapse navbar-collapse" id="navigationbar">
<ul class="nav navbar-nav">
<li><a href="<?php echo get_home_url() ?>"><span class="glyphicon glyphicon-home" aria-hidden="true"></span> Home</a></li>
<li><a href="news"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> Blog </a></li>
</ul>
</div>
</div>
</nav>