question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Writing and Reading files is not permanently

See original GitHub issue

Description

My application use json file to write some information, when i try in my IDE there is no problem. But when i transform the project in executable application

How to Reproduce

  • Create project with a Json file
  • Save text on file json
  • Close application
  • Reopen
  • File Json was load at previous version

My Environment:

  • Python version (3.10.6):
  • auto-py-to-exe version (2.23.1):
  • PyInstaller version (5.4.1):
  • Eel version (0.14.0):

Additional context

Test project -> TestIOReport

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
brentvollebregtcommented, Sep 27, 2022

There is a help post that is linked in the README, top of auto-py-to-exe and bottom of auto-py-to-exe after each build. In this post, I discuss The Difference Between One Directory and One File - I highly recommend you give that a read.

I believe you are trying to overwrite a file that is part of the initial bundle and are expecting it to stay modified after each run - this is not how one-file mode works. one-file mode unbundles on each run meaning all modified files within the bundles are reset (more about this in the post).

0reactions
FrenkyDemacommented, Sep 27, 2022

ok, ok sorry for the inconvenience, now I’ll try

Read more comments on GitHub >

github_iconTop Results From Across the Web

file.write() not permanently writing to file python - Stack Overflow
HOWEVER: When I run the script a second time, the output is exactly the same, and when I examine the text file, the...
Read more >
Permanently setting files in the Documents folder to Read and ...
Whenever I go to edit the files, it says that they have been checked as read only.
Read more >
Reading and Writing Files in Python (Guide) - Real Python
In most cases, upon termination of an application or script, a file will be closed eventually. However, there is no guarantee when exactly...
Read more >
6.1. Reading and Writing Files — Runestone Interactive ...
When we open a file for writing, a new, empty file with that name is created and made ready to accept our data....
Read more >
Reading and Writing Files With NodeJS - TutorialEdge.net
In this tutorial I'm going to be showing you exactly how we can read and write files on our local filesystem using NodeJS....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found