A
A
Anatoly Belousov2021-11-15 17:54:39
Python
Anatoly Belousov, 2021-11-15 17:54:39

How to implement python program uninstall?

Good day! I made a comic python file that does not do much harm, but I don’t know how to implement self-destruction of this script after launch! How to do it? To avoid further transfer of the script to other people.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Python Newbie, 2021-11-15
@no_name_774

Use the os module.
Import: import os
And to delete use:

os.remove(__ file__) #__ file__ это имя файла который вы запустили и оно будет использоваться для удаления

CAREFULLY!!! the file is not transferred to the trash

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question