Question

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?

Was it helpful?

Solution

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'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top