I want to read the number of CPU from the terminal.
Number_of_process_to_run = int(input("Number of Process you want to run : "))
number_of_threads = (os.system("lscpu | grep 'CPU(s):' | head -1 | awk '{print $2}'"))
nt = int (input("Your Number of Threads is :" +str(number_of_threads)))
The number of threads which is grepped from os.system is not passing into the number of threads. It's taking a null value.