I am programming a software that does manipulation of my screens (3 monitors).
I would like to add a variable in my line os.system(R'"command line here"')
import os
os.getcwd()
os.system(R'"tools\MultiMonitorTool.exe /MoveWindow "\\.\DISPLAY5" Process "msedge.exe""')
os.system(R'"tools\MultiMonitorTool.exe /MoveWindow "\\.\DISPLAY1" Process "Pos.exe""')
os.system(R'"tools\MultiMonitorTool.exe /MoveWindow "\\.\DISPLAY2" Process "chrome.exe""')
I would like to replace the words \\.\DISPLAY#
with a variable in my configurations.ini file. I succeeded in displaying the information in my configurations.ini file but I can't insert it in my os.system()
code, it always gives an error.
Each computer has a different screen configuration. So I need to have a config file with the info for each installation.
My configuratoins.ini
[Configuration]
frontview = \\DISPLAY5
topview = \\DISPLAY2
mainview = \\DISPLAY1
source https://stackoverflow.com/questions/73144140/how-to-add-variables-to-os-system-command
Comments
Post a Comment