[Tutor] passing unknown no of arguments

Alan Gauld alan.gauld at btinternet.com
Thu Feb 5 09:57:15 CET 2009


"amit sethi" <amit.pureenergy at gmail.com> wrote

> How do you pass arguments of unknown no. of arguments to a function.

search the docs for *args and *kwargs


> Also how can i run my python scripts in a web browser.

In general you can't. You would need to have a Python interpreter
in your browser. The only reliable way to run code in a browser is
to use JavaScript.

That having been said there are some options.
The pythonwin extensions include a script to enable Python
as an ActiveScripting language and in that case you can
run Python inside IE on a PC with WSH enabled.

Also there are some tools around that will embed an
interpreter into a web page. But in my experience they
are not suitable for running any significant amount of code
they are really intended for tutorial type applications.

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 




More information about the Tutor mailing list