Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #72106 > unrolled thread

Re: Check to see if the script has been previously used?

Started byChris Angelico <rosuav@gmail.com>
First post2014-05-27 18:25 +1000
Last post2014-05-27 18:25 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Check to see if the script has been previously used? Chris Angelico <rosuav@gmail.com> - 2014-05-27 18:25 +1000

#72106 — Re: Check to see if the script has been previously used?

FromChris Angelico <rosuav@gmail.com>
Date2014-05-27 18:25 +1000
SubjectRe: Check to see if the script has been previously used?
Message-ID<mailman.10365.1401179127.18130.python-list@python.org>
On Tue, May 27, 2014 at 5:45 PM, KC Sparks <kcrsparks@gmail.com> wrote:
> I was wondering if there was an extension or way that would allow me to
> print instructions if it is the first the the user has used the script.

The trickiest part is defining the 'user'. Generally, this sort of
thing is done by creating a file; if the file's not there, it's the
first time. Some versions of sudo will create a file called
.sudo_as_admin_successful in the user's home directory; others create
/var/lib/sudo/<username> as a directory, and storing information
there. Either technique works well for recognizing a first-time user.

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web