Update q.py to make it work on windows

On Windows, the log is stored in the current folder, and the file name is changed from q to loq, just to make the filename less possible to collide with other files. It still might be a bad approach, though.