diff --git a/main/HotspotAutoLogin.pyw b/main/HotspotAutoLogin.pyw index 7a835de..6f14092 100644 --- a/main/HotspotAutoLogin.pyw +++ b/main/HotspotAutoLogin.pyw @@ -21,7 +21,11 @@ dns.resolver.default_resolver = dns.resolver.Resolver() from urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning) - +################################# REMOVE THIS BEFORE USING PYINSTALLER ################################# +# Change the current working directory to the script's directory +script_dir = os.path.dirname(os.path.abspath(__file__)) +os.chdir(script_dir) +################################# REMOVE THIS BEFORE USING PYINSTALLER ################################# # Program Information program_name = "HotspotAutoLogin" @@ -1005,4 +1009,4 @@ if __name__ == '__main__': # Start the network status checking in the main thread check_network_status() # Wait for all threads to finish - tray_thread.join() \ No newline at end of file + tray_thread.join()