Is there a way to find the path of the a running python script? I'm trying to get it from __file__ or sys.argv[0]. But both of them give errors. When I tried __file__, it says __file__ is not defined. When i tried sys.argv[0], it says 'module' object has no attribute 'argv'. Thanks,