473,624 Members | 2,238 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

app with standalone gui and web interface

What would the simplest way to make an application that has both a web
interface and runs from behind a web server but also can be used as a
standalone app with a gui? More precisely is it possible to avoid
creating an html/xml/whatever based web interface for the web version
and separately creating a gui (wxpython for example) for the
standalone version and instead create a graphical frontend at once
that can be used for both?
Oct 3 '06 #1
3 1937
Hi Daniel.
What would the simplest way to make an application that has both a web
interface and runs from behind a web server but also can be used as a
standalone app with a gui? More precisely is it possible to avoid
creating an html/xml/whatever based web interface for the web version
and separately creating a gui (wxpython for example) for the
standalone version and instead create a graphical frontend at once
that can be used for both?
I was experimenting with something roughly similar a couple of years
ago. You might find it interesting. What I did may or may not work in
your case. It depends on what you want to be able to do in the
application.

I built an application that consisted of some server side Java/JSPs
that gave out XML. I used two stylesheets to transform the data into
either HTML (for the web version) or another XML-format called wxWML
(for the wxPython version). Desktop users accessed the application via
a custom "webbrowser " that translates the wxWML to wxPython code which
is executed to generate the GUI. This way, anyone with the wxBrowser
installed could access the application as if it was a desktop app.

But you should know that this was an experiment. We ended up not using
it because it felt weird and because there was not much extra gain to
be had from the desktop part. You should also know that the wxBrowser
is a HUGE security hole which is a good reason not to use it.

You can still download the code I wrote and a "tutorial" PDF from
http://www.pulp.se/wx/ but I haven't touched it since last summer so
I'm not sure it works with the latest version of wxPython. Also, I just
noted that the example URL that I point to on that page doesn't work
because I've moved my hosting since then, but that can be fixed.

Good luck
Johan Lindberg
jo***@pulp.se

Oct 3 '06 #2
What would the simplest way to make an application that has both a web
interface and runs from behind a web server but also can be used as a
standalone app with a gui? More precisely is it possible to avoid
creating an html/xml/whatever based web interface for the web version
and separately creating a gui (wxpython for example) for the
standalone version and instead create a graphical frontend at once
that can be used for both?

I was experimenting with something roughly similar a couple of years
ago. You might find it interesting. What I did may or may not work in
your case. It depends on what you want to be able to do in the
application.

I built an application that consisted of some server side Java/JSPs
that gave out XML. I used two stylesheets to transform the data into
either HTML (for the web version) or another XML-format called wxWML
(for the wxPython version). Desktop users accessed the application via
a custom "webbrowser " that translates the wxWML to wxPython code which
is executed to generate the GUI. This way, anyone with the wxBrowser
installed could access the application as if it was a desktop app.

But you should know that this was an experiment. We ended up not using
it because it felt weird and because there was not much extra gain to
be had from the desktop part. You should also know that the wxBrowser
is a HUGE security hole which is a good reason not to use it.

You can still download the code I wrote and a "tutorial" PDF from
http://www.pulp.se/wx/ but I haven't touched it since last summer so
I'm not sure it works with the latest version of wxPython. Also, I just
noted that the example URL that I point to on that page doesn't work
because I've moved my hosting since then, but that can be fixed.

Thanks for the suggestions, I'll look into both methods. Having a
local webserver seems pretty easy and convenient.

Johan, your way of doing it resembles XUL somewhat, although I can't
say I fully understand XUL I just took a look some days ago. Let me
see if I understand your approach:

If you want to have something very dynamical you do it the way you
described with the wxwml source getting parsed, converted to wxpython
and then run by python all at once. At the same time the webserver can
fetch the same wxwml source, convert it into html/xml and send that to
the web client. Now if one wants to bypass wxbrowser and the real time
conversion to wxpython, then, sacrificing some level of dynamicness,
why not convert the wxwml source 'statically' into wxpython, bundle
that as an app and at the same time convert it also to xml/html
'statically' and have that served by a webserver. In this way any time
the gui changes one needs to go through both convertions once, bundle
the desktop app again, update the webserver but there won't be any
security whole or any magic that is not pure python or not pure
html/xml. Does this sound reasonable or am I misunderstandin g
something?

In fact something like that is the thing I'm looking for, some
language that can specify a gui and can be used to generate
'statically' both wxpython source (or some other widget set) or
html/xml source.
Oct 3 '06 #3
Johan, your way of doing it resembles XUL somewhat, although I can't
say I fully understand XUL I just took a look some days ago. Let me
see if I understand your approach:
Yes it's a lot like XUL, but there are some major differences. The most
important one is that, at least back then, you had to use JavaScript.
Also, XUL had (has) a much more limited set of widgets and you can't
escape the surrounding Browser.
If you want to have something very dynamical you do it the way you
described with the wxwml source getting parsed, converted to wxpython
and then run by python all at once. At the same time the webserver can
fetch the same wxwml source, convert it into html/xml and send that to
the web client. Now if one wants to bypass wxbrowser and the real time
conversion to wxpython, then, sacrificing some level of dynamicness,
why not convert the wxwml source 'statically' into wxpython, bundle
that as an app and at the same time convert it also to xml/html
'statically' and have that served by a webserver. In this way any time
the gui changes one needs to go through both convertions once, bundle
the desktop app again, update the webserver but there won't be any
security whole or any magic that is not pure python or not pure
html/xml. Does this sound reasonable or am I misunderstandin g
something?

In fact something like that is the thing I'm looking for, some
language that can specify a gui and can be used to generate
'statically' both wxpython source (or some other widget set) or
html/xml source.
Ok, there are ways to do that... sort of.

You could modify or extend the wxBrowser to do this but you should
really have a look at extending XRC (have a look at XRCed which comes
with wxPython if you don't know what it is). Even though it doesn't do
*everything* you want it's a good place to start.

An XRC-file is an XML-specification of a wx GUI which can be loaded by
a wxApp to generate a "static" GUI. However, if you want any sort of
functionality to go with your program you're going to have to find a
way to also include the equivalent of HTML script-tags that you can
hook into wx event-handlers. I don't think XRC has that.

Also, last time I looked, XRC is very sensitive so if you do change the
format here and there to include other stuff, make sure to remove it
before you try to parse it in the wxApp (it complains otherwise, or at
least it used to).

The wxBrowser does all of this for you, but at run time, there's
currently no way of packaging it all up in one big XML file that could
be saved as wxPython source. But it's sure doable. I don't know which
is easier but either way, I'm guessing that you're going to have to
write some code of your own.

If you decide to extend/modify the wxBrowser, let me know, I might be
able to help you out.

BR
Johan Lindberg
jo***@pulp.se

PS
You should also ask around at the wxPython-users list
(http://aspn.activestate.com/ASPN/Mai...xPython-users).

Oct 3 '06 #4

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

Similar topics

4
3027
by: commanderblop | last post by:
Hi there, I am in the process of translating an WIndows/ASP/MsSQL Content Managment System (CMS) to Linux/PHP/???. Is there a popular database I can use that will allow standalone files like Access did (which used .MDB files)? In order for the CMS to work, there needs to be a standalone database file that is self-contained, just like Access .mdb files are under Windows. I guess I am asking for an Access equivalent for
2
5415
by: Lonnie, SRC employee | last post by:
*** post for FREE via your newsreader at post.newsfeed.com *** I can figure out how to set the standalone attribute in the <? xml version="1.0 ?> tag eg <?xml version="1.0" standalone="yes" ?> closest I have got to what I need is: <?xml version="1.0" ?> <?standalone yes?> <xpg creator="crusher" version="1.0"> <etr>
5
5612
by: Robin Johnson | last post by:
Hi, I've written an engine in Javascript for running text adventure games on a web page: http://www.robinjohnson.f9.co.uk/adventure/hamlet.html (That's the only game I've written with it so far, and a version of the engine that is slightly less sophisticated than my development copy, which has cleaner code and a more authentic Infocom-style scrolling display, but I digress.)
3
4626
by: Marco | last post by:
Hello there, We're new to C# and have noticed a strange behaviour which we don't yet understand. We wrote a COM DLL (in VC++ 6.0) which performs some calculation based on some double arrays passed as input parameters to the DLL through the SetParams method defined as follows: interface ICliquet : IPricable
2
1485
by: rsupansic | last post by:
Please forgive my ignorance in posting the following question. But I have been unable to find a clear answer. I have written a word processor for writing programs in two versions, one which runs under Windows/DOS and one which runs at the Linux command line. (Having an identical interface in both is extremely useful.) The latter was compiled and written under SUSE Professional 7.0. Recently I tried to run the code under SUSE 10.0. ...
1
1545
by: VK | last post by:
It is possibly more suitable to address this question to W3C mailing list, but I'm trying here first. Could anyone comment on <http://www.w3.org/TR/REC-xml/#sec-rmd> The first statement says: "If there are external markup declarations but there is no standalone document declaration, the value "no" is assumed."
7
11654
by: tah | last post by:
Hey, Can someone please clarify, confirm, or set me straight on my understanding of a standalone="yes" attribute in the xml version element? I assume it means that the xml document containing it is standalone, and does not refer to any external document to define types. In other words, it doesn't use an external dtd to validate any types - everything used would be defined within the doc itself. In other words, you would never see an xml...
2
955
by: trullock | last post by:
Hi, Here's my problem, hopefully someone can suggest a suitable solution :) I've got a large web application project, in which i want to create a sort of plugin architecture. I'm going to need to requently add new usercontrols, which all implement the same Interface. These controls will be loaded onto a
4
2012
by: Gabriel Rossetti | last post by:
Hello everyone, I like to create a cross-platform standalone python application, like Mac OS *.app dirs. The idea is to distribute a zip file containing everything (the python interpreter and all) so that a user just unzips it and runs it. Has anyone ever done anything like that? I searched google but didn't find anything really, and currently, even in my dev env, I have to set the PYTHONPATH manually, and for a standalone app I...
0
8170
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8619
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8334
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5561
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2604
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 we have to send another system

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.