How to use in the correct way quotations marks in os.system() arguments?
(Hi, thanks in advance for your time! :))))) Well, I was trying to execute some .bat file in python. And I found the function os.startfile() that can let you to run every tipes of file: so for example, It can be ----> os.startfile("path_of_the_.bat) Searching for a while, I found that I can do the same using os.system(), where for argument I can put directly the batch command that there's in my .bat Here problems comes 'cause there're quotes! If your command is simple, you can alternate single and double quates, but what should I do if my command is complicate? In fact, I have a os.system() function and his argument that should be ----> powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::SendMessage(-1,0x0112,0xF170,2) Have you an idea to make It possible without errors? (The code should make your screen go to spleep mode)