0

Need a python script to print number of times python scripts has been executed within the script. I have tried a couple of menthod and one worked was writing the count outside the script. Here i am trying to control number of execution of script. Once it cross the n number of times executed the user should not be able to excute the script

Note: I am compiling the file and giving the compiled file to my user. I should be able to clear the counter cache and give back the user again for execution

  • Check this solution https://stackoverflow.com/questions/30961310/how-can-i-count-how-many-times-this-program-has-been-executed-in-python – Nanthakumar J J May 24 '21 at 13:36
  • There’s essentially no reliable way of doing this that can’t be broken trivially. Even if you make the script access a web server to increase the count, it’s trivial to manipulate the script such that it no longer needs to check that server. – Konrad Rudolph May 24 '21 at 13:40
  • 1
    Does this answer your question? [How can I count how many times this program has been executed in Python?](https://stackoverflow.com/questions/30961310/how-can-i-count-how-many-times-this-program-has-been-executed-in-python) – PSKP May 24 '21 at 13:40
  • @NanthakumarJJ it stores the counter as json file outside as counter.json then there is no point compiling and giving it to another user. he can change the count in counter.json i am trying to control it – samna Najeeb May 24 '21 at 13:55

0 Answers0