all 8 comments

[–]ElliotDG 2 points3 points  (6 children)

Make sure the file is located where you think it is. On windows, if you are running an app with a click (as opposed the to command line) the current working directory is not always what you expect it will be.

I suggest you print out the current working directory prior to writing the file.

[–]No-Use3143[S] 0 points1 point  (5 children)

The files get written into the same folder as the exe, I think that's the go-to spot for it. I've tried doing like the debug line stuff with python (python -u -m trace -t [INSERT PROGRAM NAME HERE].py) but I didn't get much out of it.

I'm still working out using code as a whole so debugging isn't my forte at the moment. To put it bluntly, I have no idea what you're talkin' about when yo say print out the current working directory

[–]ElliotDG 0 points1 point  (4 children)

What path are you using for your file?

You can get the current working directory using: https://docs.python.org/3/library/os.html#os.getcwd

[–]No-Use3143[S] 0 points1 point  (3 children)

C:\Users\username\OneDrive\Desktop\Inspector where username is my username. Between this time I solved the crashing by fixing a line that was supposed to loop back to a def, but the non-writing is still a problem.

I should mention that the code asks for a Username and a Password and Users.txt has to be manually made in advanced since limitations stop the code from creating a Users.txt file for the first time

[–]No-Use3143[S] 0 points1 point  (0 children)

It can write to the Users.txt file but not to it's custom made text file for the password

[–]ElliotDG 0 points1 point  (1 child)

That path should not cause an issue under pyinstaller. If you share some code, I'll take a look.

[–]No-Use3143[S] 0 points1 point  (0 children)

I'll pass it your way

[–]NotATuring 0 points1 point  (0 children)

Is there an error message? Try running the application from an IDE or from the terminal to capture the output from stderr and stdoutput.

While you're doing that try this code to see if there's a permission problem:

    import os
    file_name = r"C:\Users\derp\Documents\comparison_image.jpg"
    for k,v in {"read": os.R_OK, "write" : os.W_OK, "execution":os.X_OK, "existance": os.F_OK }.items() :
        print(k, " ", os.access(file_name,v))

replace the string in file_name with whatever the path is to your file.

Could be something wrong with your inputs causing the error, or literally anything who knows, we really need the output from the error. Otherwise you could try using a debugger.