On 22 Feb 2006, [EMAIL PROTECTED] wrote:

> my code:
> ..........
> .
> import sys, types, string, inspect
>
> input= sys.argv[1]
> print  inspect.ismodule(input)
> ................
>
> here it always give false.  as what ever  input i take it is string .
>
> my problem is i am not able to take input as a module
> help me out !


Go the other way. Every module has an atribute called `__name__'. And
this is a string. So compare the user input with e.g `sys.__name__'
(which is 'sys').


   Karl
-- 
Please do *not* send copies of replies to me.
I read the list
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to