Skip to main content
Grammar, indentation and some upper-, lower-casing corrected.
Source Link
Dave Jones
  • 4k
  • 15
  • 22

I'm trying to write a python program on my Raspberry Pi to mute/change the volume of the speaker output as soon as it runs. If I type:

amixer sset 'Master' 50%

on the terminal, the volume is increased by 50%.

However if I write a python file called filename.py with the following lines:

import os
os.system(amixer"amixer sset 'Master' 50%50%")

and run it in terminal with

sudo python filename.py

it comes up with an error

amixer: Unable to find simple control 'Master',0

How can I just run exactly the same command in terminal as I do in python?

I'm trying to write a python program on my Raspberry Pi to mute/change the volume of the speaker output as soon as it runs. If I type:

amixer sset 'Master' 50%

on the terminal, the volume is increased by 50%.

However if I write a python file called filename.py with the following lines:

import os
os.system(amixer sset 'Master' 50%)

and run it in terminal with

sudo python filename.py

it comes up with an error

amixer: Unable to find simple control 'Master',0

How can I just run exactly the same command in terminal as I do in python?

I'm trying to write a python program on my Raspberry Pi to mute/change the volume of the speaker output as soon as it runs. If I type:

amixer sset 'Master' 50%

on the terminal, the volume is increased by 50%.

However if I write a python file called filename.py with the following lines:

import os
os.system("amixer sset 'Master' 50%")

and run it in terminal with

sudo python filename.py

it comes up with an error

amixer: Unable to find simple control 'Master',0

How can I just run exactly the same command in terminal as I do in python?

Grammar, indentation and some upper-, lower-casing corrected.
Source Link

ImI'm trying to write a python fileprogram on my raspberry piRaspberry Pi to mute or change/change the volume of the speaker output when its runas soon as it runs. If iI type: amixer sset 'Master' 50% in to

amixer sset 'Master' 50%

on the terminal, the volume is increased by 50% however.

However if i makeI write a python file called filename.pyfilename.py with the following lines:

import os
os.system("amixeramixer sset 'Master' 50%"50%)

and run it in terminal with

sudo python filename.py

it comes up with an error

amixer: Unable to find simple control 'Master',0

How can I just run exactly the same command in terminal as I do in python?

Im trying to write a python file on my raspberry pi to mute or change the volume of the speaker output when its run. If i type: amixer sset 'Master' 50% in to terminal, the volume is increased by 50% however if i make a python file called filename.py with the following lines:

import os
os.system("amixer sset 'Master' 50%")

and run it in terminal with

sudo python filename.py

it comes up with an error

amixer: Unable to find simple control 'Master',0

How can I just run exactly the same command in terminal as I do in python?

I'm trying to write a python program on my Raspberry Pi to mute/change the volume of the speaker output as soon as it runs. If I type:

amixer sset 'Master' 50%

on the terminal, the volume is increased by 50%.

However if I write a python file called filename.py with the following lines:

import os
os.system(amixer sset 'Master' 50%)

and run it in terminal with

sudo python filename.py

it comes up with an error

amixer: Unable to find simple control 'Master',0

How can I just run exactly the same command in terminal as I do in python?

added 2 characters in body
Source Link
mnt
  • 93
  • 7

Im trying to write a python file on my raspberry pi to mute or change the volume of the speaker output when its run. If i type: amixer sset 'Master' 50% in to terminal, the volume is increased by 50% however if i make a python file called filename.py willwith the following lines:

import os
os.system(amixer"amixer sset 'Master' 50%50%")

and run it in terminal with

sudo python filename.py

it comes up with an error

amixer: Unable to find simple control 'Master',0

How can I just run exactly the same command in terminal as I do in python?

Im trying to write a python file on my raspberry pi to mute or change the volume of the speaker output when its run. If i type: amixer sset 'Master' 50% in to terminal, the volume is increased by 50% however if i make a python file called filename.py will the following lines:

import os
os.system(amixer sset 'Master' 50%)

and run it in terminal with

sudo python filename.py

it comes up with an error

amixer: Unable to find simple control 'Master',0

How can I just run exactly the same command in terminal as I do in python?

Im trying to write a python file on my raspberry pi to mute or change the volume of the speaker output when its run. If i type: amixer sset 'Master' 50% in to terminal, the volume is increased by 50% however if i make a python file called filename.py with the following lines:

import os
os.system("amixer sset 'Master' 50%")

and run it in terminal with

sudo python filename.py

it comes up with an error

amixer: Unable to find simple control 'Master',0

How can I just run exactly the same command in terminal as I do in python?

Source Link
mnt
  • 93
  • 7
Loading