title: Change directory to the directory of a Python script
body: <p>How do I change directory to the directory with my Python script in? So far, I figured out I should use <code>os.chdir</code> and <code>sys.argv[0]</code>. I'm sure there is a better way then to write my own function to parse argv[0].</p>