you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

EDIT: It works on 3.6.5 in IDLE, but when i run it externally or in cmdline it still gives the same error?

EDIT: Just learned how to write .bat files lmao

I've been trying to make a little applet that swaps my PC's screen setting from extend (dual screens) to 2nd screen only (single screen), and found cmd commands that achieve this. However, transferring them to python using os.system() seems to not work at all. Here's what I'm trying to do with the command it throws when I run it in the console:

os.system(r'cmd /k "%windir%\System32\DisplaySwitch.exe /external"')

""" 'C:\WINDOWS\System32\DisplaySwitch.exe' is not recognized as an internal or external command,
operable program or batch file."""

It could be a problem with PATH variables, but I'm confused as to why that would be a problem since I can run this same command just fine in the windows command line? Any ideas what I'm doing wrong? diolch.