[Tutor] Python with HTML

Steven D'Aprano steve at pearwood.info
Sun Jan 29 11:02:27 CET 2012


Evert Rol wrote:
>> hi everyone,
>>
>> I want to make a web page which has to include some python script and html tags as well, am not getting how to do that . 
>> I searched some articles but cant understand them .
>> is there anything like linking an external html file into python script ?
>>
>> Can u please help for same 
>> waiting for your instructions or some links that can help me
> 
> Not sure what you want. Do you want a HTML page that includes a Python script for the more dynamic parts?
> In that case: that won't work. Java (ecma)script is the de facto standard for this. 


While Javascript is the de facto standard for client-side scripting, it is 
possible to use Python. But you shouldn't: Python is not designed with the 
sort of sand-boxing and security needed to run untrusted code over the 
Internet. But if you only care about running code within your own trusted 
intranet, it should be perfectly doable.

http://bytes.com/topic/python/answers/45528-python-client-side-browser-script-language

A better idea may be to use a templating engine, server-side Python, e.g. 
using Django, CherryPy, or similar, or use Pyjamas to convert Python to 
Javascript.

http://warp.byu.edu/site/content/813



-- 
Steven


More information about the Tutor mailing list