Reputation: 3241
the time has come and i start think about how to build demo version of my software to show it to my clints. i make buildings via pyinstaller. i need to create programm that will be stop working after 1 or 2 days of using.
it should be easy i hope ?) i cant find any information about this buildings via pyinstaller
pyinstaller --onefile script.py
may be i need use other builder like pyfreeze ? or maybe i can do that in python logic level or setup setup file in builder?
Upvotes: 1
Views: 604
Reputation: 1105
This could be done manually by hardcoding a timelimit at the top of script.py
, using the time
module.
import time
limit_str = 'Wed Feb 26 12:30:00 2014'
limit = time.mktime(time.strptime(limit_str))
if time.time() > limit:
print 'Demo time expired!'
else:
print 'Program logic here'
Upvotes: 1