Python code works on desktop