how may i do to using bash scripting inside a python project? 11-18-2019, 12:36 AM
#1
hi
i want to learn about how may i do an application in python that read, write and even do some functions by calling bash commands in linux
imagine this:
an app that allows you to put a value, then run a command with that value as a "-" variable, so you can do something like
but... by choosing or writing the freq value using a gui or even options in a command-line python script.
something like "processor.py -freq 1"
i want to learn about how may i do an application in python that read, write and even do some functions by calling bash commands in linux
imagine this:
an app that allows you to put a value, then run a command with that value as a "-" variable, so you can do something like
Code:
#!bin/bash
freq=10 #max
freq2=2
freq3=3
freq4=4
freq5=5
freq6=6 #rec
freq7=7 #warning
freq8=8 #warning
freq9=9 #warning
freqmax=10 #warning
freqmin=1
cpu0=/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
cpu1=/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
cpu2=/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
cpu3=/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
echo $freqmax > $cpu0
echo $cpu1 $cpu2 $cpu3 | xargs -n 1 cp $cpu0but... by choosing or writing the freq value using a gui or even options in a command-line python script.
something like "processor.py -freq 1"
i'm just looking for knowledge, not pretending be great, just wanting to do stuffs
fan of internet and its story
fan of internet and its story




![[+]](https://sinister.li/images/modern/collapse_collapsed.png)