[Tutor] reafline reads file, not just 1 line
Luke Paireepinart
rabidpoobear at gmail.com
Fri Mar 30 21:00:56 CEST 2007
Kirk Bailey wrote:
>
>> This looks fine to me. How do you know it's reading them all into
>> the first item?
> I inserted some t4emporary code to print the variable name, then
> value. The
> first one spewed the entire page, the others were null strings.
Okay, just makin' sure.
>>
>>> # Begin nagware suite birthday=os.stat('..\WW.key')[-1]
>>> now=int(time.time()) month=60*60*24*30 age=now-birthday if age >
>>> month: print 'your 1 month trial period has expired.' timebomb=1
>>> else: naglist=[ 'Register and get free upgrades!','This software
>>> will expire-register today!','Shareware, not freeware. Please
>>> register!','Please register your shareware','Paying for shareware
>>> FEELS GOOD!','Your shareware dollar rewards creativity','Do YOU get
>>> paid for what you do?'] print random.choice(naglist) timebomb=0 #
>>> end nagware suite
>> You're aware that this is very easy to circumvent, right?
> Sure it is- for hackers, geeks, and programmers. For roadwarriors who
> know not bit from byte,
> who use the laptop as a tool in their career, it's cherry.
I mean... all that's required to reset the license is to delete WW.key
and your program will recreate it.
I'm pretty sure that anyone could figure that out, even the
roadwarriors. Why not just use registry keys or something?
Just deleting a file is far too easy, IMHO.
Then again, I probably wouldn't make it expire after a certain period
anyway.
> Attachments on a list? Sounds like trouble. Will they work on THIS list?
Yes. They're recommended for source code (and input files and such).
E-mail clients will wrap code at odd places, mess with tabs and spacing,
and things like that.
You should always send source as an attachment unless it's a short
snippet (or you don't expect people to run it).
Well, your problem got solved already anyway, didn't it?
Have fun coding.
P.S. please reply on-list or give some explanation why you replied
off-list, or I'll assume the private reply was an accident.
-Luke
More information about the Tutor
mailing list