1

I am new to Python, and programming in general. I am working on a Chrome-based media center, and one thing I would like it to is open Chrome in full screen automatically. Here is what I have so far. (For clarity, I am using Linux 3.16 on Ubuntu 14.10)

import time
import subprocess

#Opens Chrome
subprocess.call("google-chrome")
#Wait for Chrome to load
time.sleep(5)
#Open fullscreen
subprocess,call(["xdotool", "key", "F11"])

However, once Chrome loads, my script stops. When I close Chrome, my program continues, and executes xdotool after 5 seconds.

Any help is appreciated! Thanks!

  • 1
    Did you mean `subprocess.call` on the bottom line? Have you looked at http://stackoverflow.com/questions/636561/how-can-i-run-an-external-command-asynchronously-from-python? – matsjoyce Dec 02 '14 at 19:10
  • 3
    According to the [docs on `subprocess.call`](https://docs.python.org/2/library/subprocess.html#subprocess.call): "Run the command described by args. Wait for command to complete, then...". If you want to execute code in parallel with your subprocess, you probably want to use `subprocess.Popen`. – Joel Cornett Dec 02 '14 at 19:17
  • Yes, I did mean `subprocess.call` I'll guess I'll go try out some of the stuff you guys suggested. Thanks! – Jack Horgan Dec 02 '14 at 23:41

0 Answers0