473,480 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Embedding an Application in a Web browser

Is it possible to embed a Python application within Internet explorer?
If so how do people recommend going about it.

As for the application it has to be able display simple animated
graphics such as circles, lines and squares. However if someone clicks
on a shape it should open up another application, such as Word.

Thanks,

Rod

Python Newbie

Feb 14 '06 #1
18 3006
rodmc wrote:
Is it possible to embed a Python application within Internet explorer?
No. Nor in any other browser (except from Grail, but I think this
doesn't count).
If so how do people recommend going about it.
Either write a rich client app or a real web application.
As for the application it has to be able display simple animated
graphics such as circles, lines and squares.
Wait... Aren't there already existing technos to do this ?
However if someone clicks
on a shape it should open up another application, such as Word.


Lol. This would be a really big bad security issue.

You definitively want to write a rich client app.

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Feb 14 '06 #2
'A' Web Browser? Meaning: any random web-browser? Or specifically and
*only* Internet Explorer?

If you want it to work only and ever only in Internet Explorer, then
you can create a Python ActiveX object and embed that in your page;
using the pythonwin extensions.

Cheers,

--Tim

Feb 14 '06 #3
Perhaps IronPython could be hacked in somehow also? Seems like it
might could.

Feb 14 '06 #4
Perhaps IronPython could be hacked in somehow also? Seems like it
might could.

Feb 14 '06 #5
Thanks for all the comments.

I will elaborate slightly to give everyone an idea of what is going on.
Basically I need to create a dynamic visualisation which sits in the
active desktop, basically behind the desktop icons and in front of the
windows wallpaper. Windows lets you define a web page which can be
displayed in this way. The application itself can sit on the local
users computer, rather than actually being downloaded via the web. It
will be retrieving data from a variety of sources. If there is another
way to do it then that would be good, for example writing another
active desktop application which people can use.

The user has to be able to resize, move or get rid of the visualisation
if they wish to do so.

Best,

rod

Feb 14 '06 #6

try this: create file named "test.hta" and put inside
---------------------
<HTML>
<BODY>
<SCRIPT LANGUAGE="Python">

import sys
document.writeln("Hello from Python", sys.version)

</SCRIPT>
</BODY>
</HTML>
---------------------
double click to open it, it will work if you have activestate
extensions installed.

Feb 14 '06 #7
bruno at modulix wrote:
rodmc wrote:
Is it possible to embed a Python application within Internet explorer?


No. Nor in any other browser (except from Grail, but I think this
doesn't count).


I remember there was a project for running CGI-BIN-like programs
directly in Mozilla without a web server.

But I can't find it anymore.

Ciao, Michael.
Feb 14 '06 #8
Using the Pywin32 extensions
( http://sourceforge.net/projects/pywin32/ ) ,
you can register Python as an Active Scripting language.
Then it can be used anywhere javascript or vbscript are
used, in IE, ASP, etc. It should only be used in IE
for trusted applications, however.

Roger

"rodmc" <us***************@yahoo.co.uk> wrote in message news:11**********************@o13g2000cwo.googlegr oups.com...
Thanks for all the comments.

I will elaborate slightly to give everyone an idea of what is going on.
Basically I need to create a dynamic visualisation which sits in the
active desktop, basically behind the desktop icons and in front of the
windows wallpaper. Windows lets you define a web page which can be
displayed in this way. The application itself can sit on the local
users computer, rather than actually being downloaded via the web. It
will be retrieving data from a variety of sources. If there is another
way to do it then that would be good, for example writing another
active desktop application which people can use.

The user has to be able to resize, move or get rid of the visualisation
if they wish to do so.

Best,

rod



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Feb 14 '06 #9
DH
bruno at modulix wrote:
rodmc wrote:
Is it possible to embed a Python application within Internet explorer?


No. Nor in any other browser (except from Grail, but I think this
doesn't count).


You can if you use IronPython. Of course it will only work with
Internet Explorer on windows.
Java and JVM languages are of course much better for applets: jython,
groovy, jruby, etc. I don't know if jython or jruby applets are
actually possible however since it is interpreted.

However if someone clicks
on a shape it should open up another application, such as Word.


Lol. This would be a really big bad security issue.


Look up Microsoft's smart client api. It is their answer to java web start.
Feb 15 '06 #10
You may already know this, but I don't think anyone has mentioned it
explicitly.

You can run a Python web server (I like CherryPy) on the local machine,
and serve pages to "localhost." Everything else is just plain old
Python, and talking to the OS is no problem.

Ron

Feb 15 '06 #11
I forgot -- I like the idea of Kerrigell, too. It runs on top of
CherryPy, and lets you use python either in the server (which is just a
little program on your local machine) or embedded in the html pages, or
in a Kerrigell service, which is an application server based on Python.

So, a script to print the squares of numbers from 1 to 9 looks like:

Python script +++++++++

print "<h1>Squares</h1>"
for i in range(10):
print "%s :<b>%s</b>" %(i,i*i)
Karrigell service ++++++++

def index():
print "<h1>Squares</h1>"
for i in range(10):
print "%s :<b>%s</b>" %(i,i*i)

HTML Inside Python +++++++

"<h1>Squares</h1>"
for i in range(10):
"%s :<b>%s</b>" %(i,i*i)

Python Inside HTML +++++++

<h1>Squares</h1>
<%
for i in range(10):
print "%s :<b>%s</b>" %(i,i*i)
%>

It's certainly flexible.

As far as your animated shapes go, you have a number of unattractive
options!

Flash (my preference, if you already have the authoring software,)
openLazslo (maybe the best bet for free),
SVG (which requires a plug-in for IE,) or
creating them and making them interactive with Javascript ( see
http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm )

Ron

Feb 15 '06 #12
I forgot -- I like the idea of Kerrigell, too. It runs on top of
CherryPy, and lets you use python either in the server (which is just a
little program on your local machine) or embedded in the html pages, or
in a Kerrigell service, which is an application server based on Python.

So, a script to print the squares of numbers from 1 to 9 looks like:

Python script +++++++++

print "<h1>Squares</h1>"
for i in range(10):
print "%s :<b>%s</b>" %(i,i*i)
Karrigell service ++++++++

def index():
print "<h1>Squares</h1>"
for i in range(10):
print "%s :<b>%s</b>" %(i,i*i)

HTML Inside Python +++++++

"<h1>Squares</h1>"
for i in range(10):
"%s :<b>%s</b>" %(i,i*i)

Python Inside HTML +++++++

<h1>Squares</h1>
<%
for i in range(10):
print "%s :<b>%s</b>" %(i,i*i)
%>

It's certainly flexible.

As far as your animated shapes go, you have a number of unattractive
options!

Flash (my preference, if you already have the authoring software,)
openLazslo (maybe the best bet for free),
SVG (which requires a plug-in for IE,) or
creating them and making them interactive with Javascript ( see
http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm )

Ron

Feb 15 '06 #13
paron wrote:
I forgot -- I like the idea of Kerrigell, too. It runs on top of
CherryPy


Karrigell is independent of CherryPy, it has it's own web server built in.

Kent
Feb 15 '06 #14
Thanks, Kent -- you're right. That'll teach me to work from memory!

Ron

Feb 15 '06 #15
bruno at modulix wrote:
rodmc wrote:
Is it possible to embed a Python application within Internet explorer?


No. Nor in any other browser (except from Grail, but I think this
doesn't count).


This is simply not true!

Python can work as a Windows scripting language just as VB Script.
That means that IE can use Python just as it can use JScript or
VB Script for client side scripting in the browser.

For instance, see here:
http://www.4guysfromrolla.com/webtech/082201-1.shtml

Another issue is whether this was advisable from a security point
of view... Python isn't written to be safe. I don't want Python
client side scripting enabled in my browser... (Not that I use
IE when I can avoid it...)
Feb 15 '06 #16
paron wrote:
I forgot -- I like the idea of Kerrigell, too. It runs on top of
CherryPy, and lets you use python either in the server (which is just a
little program on your local machine) or embedded in the html pages, or
in a Kerrigell service, which is an application server based on Python.


oh sure, why make it simple, when we can make it difficult?!
your solution is like using a sledgehammer to crack a nut!

"... I keep hearing the sound of nuts being pulverized..."
http://www.bobcongdon.net/blog/2005/...dgehammer.html

Feb 15 '06 #17
>From the OP:
<snip>As for the application it has to be able display simple animated
graphics such as circles, lines and squares. However if someone clicks
on a shape it should open up another application, such as Word. Thanks,

Rod

Python Newbie </snip>

<snip>The application itself can sit on the local
users computer, rather than actually being downloaded via the web. It
will be retrieving data from a variety of sources.</snip>

I was thinking that the security provisions might make it difficult for
the script in the browser to interact with the OS. If that is "simple"
to get around, then I agree, Karrigell is overkill.

OTOH, Karrigell makes it simple to interact with the local machine's
OS, and especially if you are a beginner at Python. YMMV, of course.
Thanks for offering your opinion.

Ron

Feb 16 '06 #18
Atanas Banov wrote:
paron wrote:
I forgot -- I like the idea of Kerrigell, too. It runs on top of
CherryPy, and lets you use python either in the server (which is just a
little program on your local machine) or embedded in the html pages, or
in a Kerrigell service, which is an application server based on Python.
oh sure, why make it simple, when we can make it difficult?!


I don't see how running a local Web application server is more
difficult than messing around with ActiveX and/or Active Scripting (or
whatever it's called). Remember that Python already has various HTTP
server classes in the standard library, and making use of these classes
is very easy. I'd rather do that than touch ActiveX with a very long
stick, and the Active Scripting stuff, whilst amusing, is a known
security concern.
your solution is like using a sledgehammer to crack a nut!

"... I keep hearing the sound of nuts being pulverized..."
http://www.bobcongdon.net/blog/2005/...dgehammer.html


Why am I not surprised that the first three words of the quoted blog
article are "David Heinemeier Hansson"? Few people contributing to
comp.lang.python would suggest J2EE as a solution here, so I don't
quite see what relevance this particular hype echo from the blogosphere
has in this case, especially since running BaseHTTPServer isn't exactly
like running JBoss.

Sure, to have animated graphics is likely to stretch any Web-based
interface, despite recent support for things like SVG and
"destandardised" innovations like canvases in Web browsers. But if
cross-platform portability ever becomes an issue, the vanilla Web
application option is quite possibly the best route; whilst one can
embed Python in Konqueror with the right packages today, and whilst
support for Python scripting in Mozilla is coming along, it'll be a
long time before any piece of Python code will be able to run on more
than one of these configurations without modification. And beyond
Active Scripting, who can really be sure what Internet Explorer will
eventually support?

Paul

Feb 16 '06 #19

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2756
by: Alicia Haumann | last post by:
I accidentally sent this to webmaster@python.org, so this could be a duplicate if "webmaster" forwards it to this list. :{ Hi, there. Thanks for any help that can be offered. I've been...
1
537
by: Martin | last post by:
Greetings, I am new to python and wish to embed python in an 3D graphics application to provide application automation. The high level goal is to be able to drive my app from a script for batch...
2
2847
by: Roose | last post by:
With some googling I have found these resources: http://docs.python.org/ext/win-dlls.html http://www.python.org/doc/faq/windows.html I have a large Win32/MFC/C/C++ application that has an...
1
1809
by: Tommy Nordgren | last post by:
I want to write an application that embeds and extends (at least) the Python and Perl interpreters. Now i want to find as much as possible about the Python tools used for extending and embedding...
4
3151
by: markoueis | last post by:
Is there any way to embed a ClickOnce Application into the browser? I love the way ClickOnce works, but the problem is I would like it to display the windows form in the browser. I could use a...
6
22773
by: Edward | last post by:
I have been doing some research about embedding images in HTML using the data URL src method of the format: <img src="/-/data:image/gif;base64,<DATA>"> My question is, how does one generate...
1
362
by: Daniel Nogradi | last post by:
> Is it possible to embed a Python application within Internet explorer? > If so how do people recommend going about it. > > As for the application it has to be able display simple animated >...
6
2977
by: Qun Cao | last post by:
Hi Everyone, I am a beginner on cross language development. My problem at hand is to build a python interface for a C++ application built on top of a 3D game engine. The purpose of this python...
4
4011
by: Pini | last post by:
Hi all, I have a massive windows application that refernces a lot of assemblies and doing a lot of DAL anf IO operations. I want to expose this application to the interner so that a user can...
0
1208
by: Severian | last post by:
I am working on embedding Python 2.5 in my C++ application, and I have a few questions: 1) My application is multi-threaded; what problems should I be aware of if I create a separate interpreter...
0
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7076
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6732
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6886
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4472
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.