문제

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?

도움이 되었습니까?

해결책

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'
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top