Hi,

I'm making a password program that I want to launch every time I turn on my computer. Anyone know how I'd do this? Also, is it possible to make it so that the user is prompted to enter the password before any other files or applications can be accessed?

Here's what I have so far:

#auto open when computer is turned on
#unable to access other programs/files
import os
password = str(input('Enter password: '))

if(password == 'rabbit'):
    print("logging on...")
    #program closes.

else:
    print("This computer is shutting down...")
    os.system("shutdown -h now")

Thanks. :)

Member Avatar for sravan953

Hi,

I'm making a password program that I want to launch every time I turn on my computer. Anyone know how I'd do this? Also, is it possible to make it so that the user is prompted to enter the password before any other files or applications can be accessed?

Here's what I have so far:

#auto open when computer is turned on
#unable to access other programs/files
import os
password = str(input('Enter password: '))

if(password == 'rabbit'):
    print("logging on...")
    #program closes.

else:
    print("This computer is shutting down...")
    os.system("shutdown -h now")

Thanks. :)

As for starting the program everytime the computer starts, you can use Py2exe to compile into .exe format, then drag & drop it in:
Start>All Programs>Startup(considering you are using Win XP)

As for prompting the user to enter the password before opening anyother app, unfortunately I have no idea! :(

Hope I helped atleast a bit!

And what about on a mac?

How you run an app at startup is platform specific and has nothing to do with Python. I suggest you consult your target OSes' manuals to determine how to do this for each platform.

As for blocking other programs from starting, I have a strong suspicion that you would be unable to literally do this. What you *can* do is have your program take control of the desktop until the user enters the correct password, logging off otherwise. For this though, you would need to use a toolkit or access the platforms gui subsystem directly.

Most newer BIOS have a password option that will require a password to start the computer. Obviously, if you use this you do not want to loose the password, otherwise you will have to flash the BIOS or jump through some other hoops to be able to do anything at all.

It appears that this is done via OpenFirmware on a Mac but you'll have to research that. I'm a Linux user. http://www.google.com/search?client=opera&rls=en&q=mac+bios+password&sourceid=opera&ie=utf-8&oe=utf-8
http://maczealots.com/tutorials/security/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.