Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old March 20th, 2004, 10:34 PM
caroundw5h caroundw5h is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Canada
Posts: 181 caroundw5h User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 55 m 34 sec
Reputation Power: 0
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."


Reply With Quote
  #2  
Old March 21st, 2004, 02:21 AM
Boceifus's Avatar
Boceifus Boceifus is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 93 Boceifus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 2 h 12 m
Reputation Power: 5
Quote:
Originally Posted by caroundw5h
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.


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?!?!?

Reply With Quote
  #3  
Old March 21st, 2004, 03:24 AM
Grim Archon's Avatar
Grim Archon Grim Archon is offline
Mini me.
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Location: Cambridge, UK
Posts: 783 Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)  Folding Points: 1488 Folding Title: Novice Folder
Time spent in forums: 3 Days 2 h 15 m 57 sec
Reputation Power: 7
Send a message via MSN to Grim Archon
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.

Reply With Quote
  #4  
Old March 21st, 2004, 07:24 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,529 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 19 m 5 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
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:

1. Python packaged with the browser. In this case why not Python applets too (like in Jython).
2. Make your own installer for all the different browsers and etc. (prob requires some C/C++ :eek Although if you just made a little installer for IE i'm sure people would start using it, if only for local stuff (for now).

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.
__________________
programming language development: www.netytan.com Hula


Reply With Quote
  #5  
Old March 21st, 2004, 09:53 AM
caroundw5h caroundw5h is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Canada
Posts: 181 caroundw5h User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 55 m 34 sec
Reputation Power: 0
Quote:
Originally Posted by netytan
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:

1. Python packaged with the browser. In this case why not Python applets too (like in Jython).
2. Make your own installer for all the different browsers and etc. (prob requires some C/C++ :eek Although if you just made a little installer for IE i'm sure people would start using it, if only for local stuff (for now).

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.

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.

Reply With Quote
  #6  
Old March 21st, 2004, 11:16 AM
DevCoach DevCoach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Feb 2004
Location: London, England
Posts: 1,196 DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 13 h 42 m 7 sec
Reputation Power: 252
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

Reply With Quote
  #7  
Old March 21st, 2004, 12:38 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,529 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 19 m 5 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Python as SSI?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway