How can I load python script into Html ??

Xavier Morel xavier.morel at masklinn.net
Tue Dec 13 23:25:01 CET 2005


PatPoul wrote:
> I want to do the same thing as
> <script language="javascript" src="xxx.js"></script>
> 
> but with a python script  :
> <script language="Python" src="xxx.py"></script>
> 
> ==================================
> if xxx.py :
> def mytest():
> 	alert("test")
> 	window.document.write('test')
> ==================================
> and test.html :
> <HTML>
> <SCRIPT Language="Python" src="xxx.py"></SCRIPT>
> 
> <SCRIPT Language="Python">
> mytest()
> </SCRIPT>
> </HTML>
> ==================================
> 
> I always got this error :
> NameError : name 'mytest' is not defined
> 
> Thx ... 
> Patrick Poulin
> 
Long story short, no.

The browser needs binding to the language, and either the ability to use 
the external interpreter or embed an interpreter, and no browser 
currently has that kind of thing.



More information about the Python-list mailing list