|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Python as SSI?
Does anyone else wish or know of a way to use python like javascript? I mean all a browser needs to do is to be able to read or interperate the language right. Anyone know how that could be done. Basically using python as an alternative to javascript. I just find python goes so well with html and even web programming in general, it seems so effortless. Can python be used with html to create DHTML pages.
__________________
"In theory, there is no difference between theory and practice. But, in practice, there is."
|
|
#2
|
||||
|
||||
|
Quote:
sorry i cant be of specific help,but i do know it's possible.what you want is to search for is Jython.maybe one of These Threads will help point ya in the right direction.or i'll bet www.jython.org is a good place to start
__________________
It is not important if the glass is half full or half empty.What is important,is who has been drinking from MY glass?!?!? |
|
#3
|
||||
|
||||
|
On Windows with IE:
This is broken (for me at least)... You must have Python installed on the client machine and also the win32all package. Run: \Python23\Lib\site-packages\win32comext\axclient\client\pyscript_regex.py This registers Python with IE. Then check out the demo at: C:\Python23\Lib\site-packages\win32comext\axscript\demos\client\ie\demo.htm Mozilla is also supposed to support Python as a client side scripting language. Grim
__________________
*** Experimental Python Markup CGI V2 *** Last edited by Grim Archon : March 21st, 2004 at 03:57 AM. |
|
#4
|
||||
|
||||
|
My two cent... were i agree with you 100% about Python being a great language for web development in general!
As a client side langugae, DHTML with Python would be rather limiting since the number of people with Python installed isn't all that high. (for that matter perl would have the same problems). What you would be doing is saying "if you want to view this page properly then go get Python and win32all, install them, do some setup and you can" heheh. And even then you're only targeting Windows and IE .To make the idea work you would need:
It'd be a great idea if it could work but as things are right now it really would break a website. But (yes theres always a but) if we're talking intranet and you have some controle over what people run to view the page then go for it . Could be awesum!!!Sorry if i'm bursting bubbles here, Mark. |
|
#5
|
|||
|
|||
|
Quote:
No your not bursting my bubble. In fact your encouraging me. Thank you all. I code in C as well and I would love to attempt a problem like that. I just find python so efficent it seems a waste that it isn't supported by the browsers. I"M gonna check it out some more, but thank you all for your answers. |
|
#6
|
|||
|
|||
|
Python + Win32All is a fully compliant ActiveScripting language so in theory can be used as a scripting language for IE, just like JScript or VBScript.
HOWEVER there are two problems with this. This first is that it would restrict your users to those running IE and have Python & Win32All installed. The second and much bigger problem is that it doesn't work. It used to, but not any more. The reason it doesn't work is to do with security. When running in IE, Python uses the restricted execution module 'rexec' to stop anyone writing malicious code that could damage your system. However with the introduction of the new type system in 2.2 the rexec module became broken, and has been disabled in 2.3. This is probably why it did not work for Grim. You could delve into the COM client code and remove the rexec restrictions to enable Python in IE on your own system. This would allow you to use python for browser scripting, but only on your own computer. This could be useful if you wanted to prototype code in Python before translating it to Javascript. Other posters have mentioned using Jython as an alternative. I think there is some mileage in this, but the Jython code would run as an applet so I don't think it would be able to manipulate the DOM the way Javascript can. Even if it could, there is no guarantee that your users' browsers would be running a version of Java that was compatible with Jython - many browsers nowadays give the option of installing without Java. Sadly, I think that for the forseeable future the only viable option for browser scripting is to use Javascript. Even if say Microsoft decided to bundle Python with their next release of IE (unlikely at best) then there would still be tens of millions of browsers out there that did not support it. Sad, I know. Dave - The Developers' Coach |
|
#7
|
||||
|
||||
|
From what i know of Jython this isn't really a problem since to run a Jython applet Jython converts to Java source code which can then be compiled to a pure Java applet. That said i've never actually got a Jython applet to compile... but then i have very little interest in Java as a hole so
.But then, as a way of running Python on a system without Python, Jython is a very nice, compact way to run Python! A nice little restricted execution module that i played around with a while ago: http://www.procoders.net/pythonstuff/SandBox/ Mark. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Python as SSI? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|