On Thu, May 9, 2013 at 11:49 AM, David Goldsmith <[email protected]>wrote:
> Why a Web app? Aside from portability (so I'll be using JavaScript or > pyjamas, it sounds like), > Web apps are not more portable, really -- you just trade cross-browser issues for cross-OS issues... But anyway, you are quite right, there is an enormous amount of web development going on these days -- any developer should have a basic understanding of it, even if s/he's not going to primarily developing a web app. So the "I need to learn it, so why not use it for a project-at-hand" is a fine reason. However if learning about it from a job-qualification perspective is the primary goal, I wouldn't do Pyjamas, or Brython, or.... On the sever side, Python is a fine choice -- maybe not the most popular one, but certainly a widely used and well respected choice. But on the client side, you'll want at least a little bit of Javascript, so I'd go with "real" javascript, rather than an of the tools that try to hide it under a translation layer... Web apps now span the gamut from: "traditional" web apps, where the server serves up pages of html: forms to fill out, reports, etc....no javascript required. to "Single Page" apps -- where the entire app is running in javascript in the browser -- maybe making requests to one or more servers for data, but all the user-interaction is handle server side -- these are more like desktop apps. Most web apps these days are a hybrid of those. My advice: even with a Single Page app, you are likely to need to write a web service to back it up -- so I'd go with that start. If you do need it to look and feel more like a desktop app, then you can run it in an embedded framework -- as Mike mentioned we've done this for an app with some challenges, but not so many that I wouldn't do it again, and there are some better tools for it out there now -- check out the "Chrome Embedded Framework" (CEF) for instance (and yes, there are python bindings for it). This allows you to embed the Chrome engine in a desktop app. That would help, as you then only need to target one browser. So I'd take a survey of the Pyton Web Frameworks, and find one that seems like it suits your app. If you describe your app a bit here, I'll bet folks will offer (probably conflicting ;-) ) suggestions. -Chris OK: I'll start: check out: Pyramid Django Flask Web2Py And see what strikes your fancy. -Chris IMO (which is why I'm a little shocked that we still don't have a more > universal solution to Web apps having to jump through hoops to do something > as simple as writing to a local file--I mean, I appreciate the security > risk and all, but I'd just assumed that this would have been addressed by > now). > > It has been -- there are ways to embed HTML5 apps on IOS and Android, and there is Adobe Air for embedding on Windows and OS-X. There is Titanium, which I think does that, too, though there higher-level overview doesn't make it clear... But usually a web app is just that -- an app on the web -- so you'd be running code fro someone else's server -- you really don't want that messing with your file system without your explicitly knowing about it -- which is a standard file download from a web app. -Chris > DG > > On Thu, May 9, 2013 at 10:31 AM, > <[email protected]>wrote: > >> Send seattle-python mailing list submissions to >> [email protected] >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://lists.seapig.org/mailman/listinfo/seattle-python >> or, via email, send a message with subject or body 'help' to >> [email protected] >> >> You can reach the person managing the list at >> [email protected] >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of seattle-python digest..." >> >> >> Today's Topics: >> >> 1. Re: Off topic, except that I'd like to use Python for the >> project (Toby Champion) >> 2. Re: Off topic, except that I'd like to use Python for the >> project (Alec Koumjian) >> 3. Re: Off topic, except that I'd like to use Python for the >> project (Mike Orr) >> 4. Re: Off topic, except that I'd like to use Python for the >> project (Kevin LaTona) >> 5. Re: seattle-python Digest, Vol 109, Issue 12 (David Goldsmith) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Thu, 09 May 2013 08:01:23 -0700 >> From: Toby Champion <[email protected]> >> To: [email protected] >> Subject: Re: [SEAPY] Off topic, except that I'd like to use Python for >> the project >> Message-ID: <[email protected]> >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> >> Why a web app? >> >> On 5/8/13 11:00 PM, David Goldsmith wrote: >> > So I'm writing this GUI app using wxPython when it dawns on me: why >> > don't I write it as a Web app (by which I mean Wikipedia's second >> > definition, namely "[an] application that is coded in a >> > browser-supported programming language...and reliant on a common web >> > browser to render the application executable." Then I "discover" a >> > basic problem: Web apps don't appear to be able to straightforwardly >> > write to local files (doing so is a central function of the intended >> > app). I tried the idea of having the Web app post form inputs to a >> > compiled Python executable, which would then format the inputs and >> > write the file, but, as I came to understand it, in order for all this >> > to occur "locally," my app would have to run a local "server" to which >> > the Web app would post and which would "run" the Python >> > executable--too complicated for my purpose! (Which is to wade slowly >> > into Web app development, not dive right into the deep-end.) So the >> > "workaround" I'm contemplating now is to have the app create the >> > text--it is meant to be straight ascii, not even unicode--and render >> > it in a browser viewing object, e.g., a frame, tab, or popup, and then >> > require the user to employ the browser's File->Save Page As... menu >> > function to save the result. So my question is: can anyone point me >> > to an example of a page that uses client-side code (preferably Python, >> > of course) to process html form text inputs into a page which the code >> > then renders in a new browser view object? (Yes, I know I've probably >> > visited thousands of such already and just never registered that that >> > is what they're doing because I've never cared before.) Thanks! >> > >> > OlyDLG >> >> >> >> ------------------------------ >> >> Message: 2 >> Date: Thu, 9 May 2013 08:05:35 -0700 >> From: Alec Koumjian <[email protected]> >> To: Seattle Python Interest Group <[email protected]> >> Subject: Re: [SEAPY] Off topic, except that I'd like to use Python for >> the project >> Message-ID: >> <CAEtQDuSBTC1BVB9Dv7dO3uSaE66= >> [email protected]> >> Content-Type: text/plain; charset="utf-8" >> >> I have not used it, but have heard good things about http://kivy.org/ >> >> >> >> On Thu, May 9, 2013 at 8:01 AM, Toby Champion <[email protected] >> >wrote: >> >> > Why a web app? >> > >> > >> > On 5/8/13 11:00 PM, David Goldsmith wrote: >> > >> >> So I'm writing this GUI app using wxPython when it dawns on me: why >> don't >> >> I write it as a Web app (by which I mean Wikipedia's second definition, >> >> namely "[an] application that is coded in a browser-supported >> programming >> >> language...and reliant on a common web browser to render the >> application >> >> executable." Then I "discover" a basic problem: Web apps don't appear >> to >> >> be able to straightforwardly write to local files (doing so is a >> central >> >> function of the intended app). I tried the idea of having the Web app >> post >> >> form inputs to a compiled Python executable, which would then format >> the >> >> inputs and write the file, but, as I came to understand it, in order >> for >> >> all this to occur "locally," my app would have to run a local "server" >> to >> >> which the Web app would post and which would "run" the Python >> >> executable--too complicated for my purpose! (Which is to wade slowly >> into >> >> Web app development, not dive right into the deep-end.) So the >> >> "workaround" I'm contemplating now is to have the app create the >> text--it >> >> is meant to be straight ascii, not even unicode--and render it in a >> browser >> >> viewing object, e.g., a frame, tab, or popup, and then require the >> user to >> >> employ the browser's File->Save Page As... menu function to save the >> >> result. So my question is: can anyone point me to an example of a page >> >> that uses client-side code (preferably Python, of course) to process >> html >> >> form text inputs into a page which the code then renders in a new >> browser >> >> view object? (Yes, I know I've probably visited thousands of such >> already >> >> and just never registered that that is what they're doing because I've >> >> never cared before.) Thanks! >> >> >> >> OlyDLG >> >> >> > >> > >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://lists.seapig.org/pipermail/seattle-python/attachments/20130509/10249841/attachment-0001.html >> > >> >> ------------------------------ >> >> Message: 3 >> Date: Thu, 9 May 2013 09:09:36 -0700 >> From: Mike Orr <[email protected]> >> To: Seattle Python Interest Group <[email protected]> >> Subject: Re: [SEAPY] Off topic, except that I'd like to use Python for >> the project >> Message-ID: >> <CAH9f=uqSY_s9z-_d_LbZ=0VoJgh_3teDk= >> [email protected]> >> Content-Type: text/plain; charset="iso-8859-1" >> >> On Wed, May 8, 2013 at 11:00 PM, David Goldsmith <[email protected] >> >wrote: >> >> > So I'm writing this GUI app using wxPython when it dawns on me: why >> don't >> > I write it as a Web app (by which I mean Wikipedia's second definition, >> > namely "[an] application that is coded in a browser-supported >> programming >> > language...and reliant on a common web browser to render the application >> > executable." Then I "discover" a basic problem: Web apps don't appear >> to >> > be able to straightforwardly write to local files (doing so is a central >> > function of the intended app). >> > >> >> You could write it as a browser plug-in. That would be mainly Javascript >> but it would be able to write local files. It would be specific to one >> browser type though. >> >> Is this program for yourself or your colleagues, or would end-users need >> to >> install it themselves? If you have to support users long-distance, you may >> want to stick to a desktop app. That way they can use a one-click >> installer >> in their familiar manner. >> >> Chris and I have a hybrid web-desktop application; the desktop mode being >> a >> wxPython application running a Pylons daemon and an embedded browser, >> wrapped up in py2exe (Windows) or py2app (Mac) for the installer. It works >> but it's kind of kludgey and not that excellent, and it took a while to >> get >> py2exe to work right. Web applications are great for things that are >> inherently HTMLy or thin client-y, but not so great if you need things >> beyond that like writing to files, a "desktop app feel", or a "desktop app >> installation experience". >> >> Toby wrote: >> > Why a web app? >> >> A funny thing about this group is that because we all work in the computer >> field, many of us don't trust computers any farther than we can throw them >> (and the same for social networks, smartphones, etc). The boosters will >> tell you to make everything a webapp (or even better a Facebook app) >> because PCs are so 1990s, but you'll be happier if you ask whether it's >> really a good fit for the web. >> >> - Can it be recast to depend only on typcal webapp capabilities and still >> be *convenient* for the user? If yes, a webapp might be the way to go. If >> no, you're shorehorning. >> >> - Is the main problem you writing a complex application, or users getting >> frustrated installing/upgrading it? If the latter, a webapp will >> automatically install and upgrade. If the former, the primary issue may be >> what's easiest for you to write. >> >> - If you're looking for a target application to gain experience in web >> programming, is this the right application for it? >> >> - There are two different kinds of web applications nowadays. The mainly >> server-side ones in Pylons/Django/Flask/etc, and the mainly client-side >> ones in Javascript (or perhaps Pyjamas). Each has some different >> capabilities and advantages/disadvantages. >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://lists.seapig.org/pipermail/seattle-python/attachments/20130509/b32024f9/attachment-0001.html >> > >> >> ------------------------------ >> >> Message: 4 >> Date: Thu, 9 May 2013 09:40:20 -0700 >> From: Kevin LaTona <[email protected]> >> To: Seattle Python Interest Group <[email protected]> >> Subject: Re: [SEAPY] Off topic, except that I'd like to use Python for >> the project >> Message-ID: <[email protected]> >> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes >> >> >> > On 5/8/13 11:00 PM, David Goldsmith wrote: >> > So I'm writing this GUI app using wxPython when it dawns on me: why >> > don't I write it as a Web app (by which I mean Wikipedia's second >> > definition, >> >> >> >> >> Some other ideas to look at for a GUI are: >> >> >> TideSDK | Create multi-platform desktop apps with HTML5, CSS3 and >> JavaScript. It has a Js to Python Bridge that looks like an >> interesting idea. >> http://www.tidesdk.org/ >> >> >> Python Wrapper for Google V8 Javascript Engine >> http://code.google.com/p/pyv8/ >> >> >> PyV8 is being used in this sublime plugin >> Emmet (ex-Zen Coding) for Sublime Text. ( For any sublime user this is >> an interesting plugin idea worth looking at for HTML page coding. ) >> https://github.com/sergeche/emmet-sublime >> >> >> OS X GUI >> The most important usage of this is writing Cocoa GUI applications on >> Mac OS X in pure Python >> http://pythonhosted.org/pyobjc/ >> >> -Kevin >> >> >> >> >> >> ------------------------------ >> >> Message: 5 >> Date: Thu, 9 May 2013 10:31:14 -0700 >> From: David Goldsmith <[email protected]> >> To: Seattle Python Interest Group <[email protected]> >> Subject: Re: [SEAPY] seattle-python Digest, Vol 109, Issue 12 >> Message-ID: >> < >> caftpszoidmitp6zbrab9rhahbr-4ok_wci9t3bcoslzzq84...@mail.gmail.com> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Thanks, guys! >> >> DG >> >> Message: 5 >> >> > Date: Wed, 8 May 2013 23:44:55 -0700 >> > From: Jim Gray <[email protected]> >> > To: Seattle Python Interest Group <[email protected]> >> > Subject: Re: [SEAPY] Off topic, except that I'd like to use Python for >> > the project >> > Message-ID: >> > < >> > ca+y4obucdjfm4wpqesav+gacsodhbki2gzkggxhyz2wuu+r...@mail.gmail.com> >> > Content-Type: text/plain; charset="iso-8859-1" >> > >> > I think you're talking about Flask & Flask-WTF. >> > >> > Jim >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: < >> > >> http://lists.seapig.org/pipermail/seattle-python/attachments/20130508/022e97d2/attachment-0001.html >> > > >> > >> > ------------------------------ >> > >> > Message: 6 >> > Date: Thu, 9 May 2013 07:05:04 -0400 >> > From: Chris Barker - NOAA Federal <[email protected]> >> > To: Seattle Python Interest Group <[email protected]> >> > Subject: Re: [SEAPY] Off topic, except that I'd like to use Python for >> > the project >> > Message-ID: <-7154996020384609227@unknownmsgid> >> > Content-Type: text/plain; charset=UTF-8 >> > >> > David, >> > >> > Depending on what you need to do, running a python based web server is >> > actually remarkably easy--there are a bunch of web frameworks that are >> > each suited to different uses, but one or more is likely to suit your >> > needs. >> > >> > That being said, an all-in-the browser app could be a fine option as >> > well. Look for info on "single page" apps, or " rich Internet apps" >> > for info. >> > >> > Note that the only language in browsers is JavaScript , so that's what >> > you need to use. The exceptions to this are other languages that are >> > translated to JavaScript. For python, check out pyjamas and brython. >> > >> > In fact, pyjamas may be just what you need ( short of using JavaScript >> > directly). If you do want to go the JavaScript route, check out >> > backbone.js >> > >> > Good luck! >> > >> > Chris >> > >> > On May 9, 2013, at 2:00 AM, David Goldsmith <[email protected]> >> > wrote: >> > >> > > So I'm writing this GUI app using wxPython when it dawns on me: why >> > don't I write it as a Web app (by which I mean Wikipedia's second >> > definition, namely "[an] application that is coded in a >> browser-supported >> > programming language...and reliant on a common web browser to render the >> > application executable." Then I "discover" a basic problem: Web apps >> don't >> > appear to be able to straightforwardly write to local files (doing so >> is a >> > central function of the intended app). I tried the idea of having the >> Web >> > app post form inputs to a compiled Python executable, which would then >> > format the inputs and write the file, but, as I came to understand it, >> in >> > order for all this to occur "locally," my app would have to run a local >> > "server" to which the Web app would post and which would "run" the >> Python >> > executable--too complicated for my purpose! (Which is to wade slowly >> into >> > Web app development, not dive right into the deep-end.) So the >> > "workaround" I'm contemplating now is to have the a >> > pp create the text--it is meant to be straight ascii, not even >> > unicode--and render it in a browser viewing object, e.g., a frame, tab, >> or >> > popup, and then require the user to employ the browser's File->Save Page >> > As... menu function to save the result. So my question is: can anyone >> > point me to an example of a page that uses client-side code (preferably >> > Python, of course) to process html form text inputs into a page which >> the >> > code then renders in a new browser view object? (Yes, I know I've >> probably >> > visited thousands of such already and just never registered that that is >> > what they're doing because I've never cared before.) Thanks! >> > > >> > > OlyDLG >> > >> > >> > End of seattle-python Digest, Vol 109, Issue 12 >> > *********************************************** >> > >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://lists.seapig.org/pipermail/seattle-python/attachments/20130509/a0b9296c/attachment.html >> > >> >> End of seattle-python Digest, Vol 109, Issue 13 >> *********************************************** >> > > > > -- > From "A Letter From The Future" in "Peak Everything" by Richard Heinberg: > > "By the time I was an older teenager, a certain...attitude was developing > among the young people...a feeling of utter contempt for anyone over a > certain age--maybe 30 or 40. The adults had consumed so many resources, > and now there were none left for their own children...when those adults > were younger, they [were] just doing what everybody else was doing...they > figured it was normal to cut down ancient forests for...phone books, pump > every last gallon of oil to power their SUV's...[but] for...my generation > all that was just a dim memory...We [grew up] living in darkness, with > shortages of food and water, with riots in the streets, with people begging > on street corners...for us, the adults were the enemy." > > Want to *really* understand what's *really* going on? Read "Peak > Everything." > > > -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [email protected]
