pythonpython-2.7xquartz

Python script causes XQuartz to launch


I'm using Mac OS 10.9 trying to make a python script work. However for some reason each time I start the script from the terminal it causes XQuartz to start. The version of Python is 2.7.5. Whenever I quit XQuartz I get this message in the console:

XIO:  fatal IO error 35 (Resource temporarily unavailable) on X server "/tmp/launch-mumXCj/org.macosforge.xquartz:0"
      after 24 requests (23 known processed) with 0 events remaining.

I'm not exactly sure why. When I run my script (a very simple web server) in WingIDE it works perfectly, but not from the terminal.

This gist contains my code: Gist


Solution

  • So apparently, the shebang must be the first line. There can't be any comments before it which was causing the problem. With comments moved afterwards it works just fine.