Run wine commands from Python 3.6 on Mac OSX
问题 I am trying to write a script in Python which opens wine and then sends code to the wine terminal to open a .exe program. The .exe program is also command driven. I can open wine , but I can't get any further: import shlex, subprocess line = "/usr/bin/open -n -a /Applications/Wine\ Stable.app" line2 = '''cd /Applications/application/ && wine application.exe /h1 /k0 Z:/Users/myname/Desktop/File.TXT''' line = shlex.split(line) p1 = subprocess.Popen(line) p1.stdin.write(line2.encode()) The above