No subject

Benjamin Kaplan benjamin.kaplan at case.edu
Wed Apr 15 16:42:24 EDT 2009


On Wed, Apr 15, 2009 at 4:35 PM, fridash13 <fridash13 at yahoo.com> wrote:

> i am quite new to python ...
>
> i made a small script ,, for active directory using python
>
> all the script does is basicly explor the AD for a number of tasks ..
>
> * 1 .Find a user (quick method)
> * 2 .Find a computer (quick method)
> * 3 .List all users
> * 4 .List users in an OU
> * 5 .List all groups
> * 6 .Show the members of a group
> * 7 .Show the types of a group
> * 8 .List the groups a user is in
>
> i have used the AD moudle for this script ..
>
> my question is this i have the follwing code :
>
> # find user (
> elif choice == "1":
> import active_directory
> user = active_directory.find_user ("ron")
> print user
>
> how can i make the entry for the "user" (in this case ("ron")
> shift according to raw input from the user
>
> so if the user typs jhonny it will replace ("ron")
>
> i need the ability to replace the name
> how can i accomplise this ?
>

Python tries to be pretty intuitive. You get raw input from the user by
using raw_input.

name = raw_input("enter a user: ")
user = active_directory.find_user(name)

>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090415/8986df12/attachment.html>


More information about the Python-list mailing list