reading arguments in python script when passed from URL
Rhodri James
rhodri at wildebst.demon.co.uk
Wed Apr 15 19:26:44 EDT 2009
On Wed, 15 Apr 2009 07:24:24 +0100, phaneendra s <phaneendra21 at gmail.com>
wrote:
> hi alll..
>
>
> iam invoking a python script from a standalone client which looks lik
> this
>
>
> String command="ln -s /usr/lib /tmp/lin"; //creating a soft link
>
> URL url = new URL("http://server-name/cgi-bin/finalexec1.py?command=
> "+command);
>
> but iam not able to read this command in the python script
>
> in my script i tried doing
> for arg in sys.argv;
> print arg
>
>
> but the command is not being read......
>
> is it the right way of reading arguments in python script?
If you fix the indentation, and use a colon instead of a
semi-colon, and import sys first, then yes. Your "standalone
client" however makes no sense to me at all. How *exactly*
are you invoking your Python script?
--
Rhodri James *-* Wildebeeste Herder to the Masses
More information about the Python-list
mailing list