#๐ how to properly close a script? without memory leaks or hidden background processes?
28 messages ยท Page 1 of 1 (latest)
@still wasp
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Most things should close themselves when your script quits.
If you've dispatched subprocesses, they need to be waited for, or tidies up, or ok to keep running - they're outside the Python interpreter's scope.
Threads will be joined by Python before it quits anyway (so they do need to be told to stop) except for daemon threads, which Python will terminate.
Probably.
This sounds like a GUI widget. What GU stuff are you using? tkinter? Something else?
Hey @still wasp!
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
im afraid of threading, pymem, and tkinter
You'll have to make your own decisions about how the subprocesses are handled.
What are you using the threads for?
to auto update
running the script after editing it over and over again
kinda slows down my pc sometimes
so thats why i want an efficient exit
root.destroy() just removes the root window and its descendands. root.quit() quits the GUI mainloop.
Exiting your programme should do both for you automatically.
Bookmark this page: https://tkdocs.com/shipman/universal.html
By reimporting things, or what?
You should probably show the threads code.
If it's just sitting there waiting for changes, you could make it a daemon thread, then Python will tidy it up.
I know nothing about pymem.
it answers alot of questions
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.