Re: PEP 594 cgi & cgitb removal

2019-06-01 Thread Peter J. Holzer
On 2019-05-25 23:45:06 +0200, Roel Schroeven wrote: > Jon Ribbens via Python-list schreef op 25/05/2019 om 21:00: > > On 2019-05-25, Michael Torrie wrote: > > > On 05/24/2019 04:27 AM, Jon Ribbens via Python-list wrote: > > > > Sorry, in what sense

Re: PEP 594 cgi & cgitb removal

2019-05-29 Thread Robin Becker
... More specifically, with CGI the webserver starts a new process for every single request. That's bad enough for a light C program, but it's certainly not a good idea to start a whole new Python process for every request. At least not for any production website or web se

Re: PEP 594 cgi & cgitb removal

2019-05-28 Thread Rhodri James
ed to be more useful to more people than some of the old modules.  The module proposed for deletion are all or most all more than 20 years old, before there was a PyPI.  Some, like cgi and cgitb were legitimately put in the stdlib.  Others were specialist modules that today would not go in the s

Re: PEP 594 cgi & cgitb removal

2019-05-25 Thread Roel Schroeven
Jon Ribbens via Python-list schreef op 25/05/2019 om 21:00: On 2019-05-25, Michael Torrie wrote: On 05/24/2019 04:27 AM, Jon Ribbens via Python-list wrote: Sorry, in what sense do you mean "Serverless is CGI"? As far as I can tell, it's just a script to automatically upload bi

Re: PEP 594 cgi & cgitb removal

2019-05-25 Thread Marko Rauhamaa
Jon Ribbens : > On 2019-05-25, Michael Torrie wrote: >> Not really. Serverless just means stateless web-based remote >> procedure calls. This is by definition what CGI is. > > No, it isn't. CGI is a specific API and method of calling a program in > order to se

Re: PEP 594 cgi & cgitb removal

2019-05-25 Thread Jon Ribbens via Python-list
On 2019-05-25, Michael Torrie wrote: > On 05/24/2019 04:27 AM, Jon Ribbens via Python-list wrote: >> Sorry, in what sense do you mean "Serverless is CGI"? >> >> As far as I can tell, it's just a script to automatically upload >> bits of code into vari

Re: PEP 594 cgi & cgitb removal

2019-05-24 Thread Michael Torrie
On 05/24/2019 04:27 AM, Jon Ribbens via Python-list wrote: > On 2019-05-23, Gunnar Þór Magnússon wrote: >>> nginx is the current hotness. CGI has not been hotness since the >>> mid 90s. >> >> Serverless is the new hotness, and serverless is CGI. Technology is

Re: PEP 594 cgi & cgitb removal

2019-05-24 Thread Michael Torrie
On 05/24/2019 01:24 PM, Marko Rauhamaa wrote: > There's a programming language arms race. Python wants to beat Java, C# > and go in the everything-for-everybody game. Python developers seem to > take the popularity of the language as proof of success. Pride goes > before the fall. I don't see this

Re: PEP 594 cgi & cgitb removal

2019-05-24 Thread Terry Reedy
some of the old modules. The module proposed for deletion are all or most all more than 20 years old, before there was a PyPI. Some, like cgi and cgitb were legitimately put in the stdlib. Others were specialist modules that today would not go in the stdlib. Does anyone really think

Re: PEP 594 cgi & cgitb removal

2019-05-24 Thread Marko Rauhamaa
Paul Rubin : > Stéphane Wirtel writes: >> Not a massive effort, but we are limited with the resources. > > I keep hearing that but it makes it sound like Python itself is in > decline. That is despite the reports that it is now the most popular > language in the world. It also makes me ask why the

Re: PEP 594 cgi & cgitb removal

2019-05-24 Thread D'Arcy Cain
On 2019-05-22 03:51, Robin Becker wrote: > In PEP 594 t has been proposed that cgi & cgitb should be removed. I > suspect I am not the only person in the world that likes using cgi and > cgitb. I use both heavily. Just another data point. I wasn't going to respond with a &quo

Re: PEP 594 cgi & cgitb removal

2019-05-24 Thread Stéphane Wirtel
other people have objected to the removal of these modules.  I suspect that at least 2 of you 4 are at least as technically qualified to be a core developer as I am.  A request to become the maintainer of cgi and cgitb *might* affect the decision. A quick read-through of the modules (I am supposed

Re: PEP 594 cgi & cgitb removal

2019-05-24 Thread Jon Ribbens via Python-list
On 2019-05-23, Gunnar Þór Magnússon wrote: >> nginx is the current hotness. CGI has not been hotness since the >> mid 90s. > > Serverless is the new hotness, and serverless is CGI. Technology is > cyclical. Sorry, in what sense do you mean "Serverless is CGI"? As

Re: PEP 594 cgi & cgitb removal

2019-05-23 Thread Gunnar Þór Magnússon
> nginx is the current hotness. CGI has not been hotness since the mid 90s. Serverless is the new hotness, and serverless is CGI. Technology is cyclical. -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP 594 cgi & cgitb removal

2019-05-23 Thread Rhodri James
o the removal of these modules.  I suspect that at least 2 of you 4 are at least as technically qualified to be a core developer as I am.  A request to become the maintainer of cgi and cgitb *might* affect the decision. A quick read-through of the modules (I am supposed to be working right now) sug

Re: PEP 594 cgi & cgitb removal

2019-05-23 Thread Jon Ribbens via Python-list
On 2019-05-23, Paul Rubin wrote: > dieter writes: >> Should "cgi" disappear from the standard library > > It's also a concern that cgi may be disappearing from web servers. Last > I heard, nginx didn't support it. That's part of why I still use >

Re: PEP 594 cgi & cgitb removal

2019-05-22 Thread dieter
Robin Becker writes: > In PEP 594 t has been proposed that cgi & cgitb should be removed. I > suspect I am not the only person in the world that likes using cgi and > cgitb. Currently, "Zope" is using "cgi"; it uses "zExceptions" (--> PyPI) fo

Re: PEP 594 cgi & cgitb removal

2019-05-22 Thread Terry Reedy
On 5/22/2019 3:51 AM, Robin Becker wrote: In PEP 594 t has been proposed that cgi & cgitb should be removed. I suspect I am not the only person in the world that likes using cgi and cgitb. I suspect that there will be at least one person objecting to each removal. But the underlying i

Re: PEP 594 cgi & cgitb removal

2019-05-22 Thread Tim Chase
On 2019-05-22 08:51, Robin Becker wrote: > In PEP 594 t has been proposed that cgi & cgitb should be removed. > I suspect I am not the only person in the world that likes using > cgi and cgitb. /me waves from the the back row as another cgi/cgitb user... -tkc -- https://ma

Re: PEP 594 cgi & cgitb removal

2019-05-22 Thread inhahe
Re cgitb, not sure if this is what you want, but I just came across this this week: https://github.com/cknd/stackprinter On Wed, May 22, 2019 at 3:52 AM Robin Becker wrote: > In PEP 594 t has been proposed that cgi & cgitb should be removed. I > suspect I am not the only person in

Re: PEP 594 cgi & cgitb removal

2019-05-22 Thread Rhodri James
On 22/05/2019 08:51, Robin Becker wrote: In PEP 594 t has been proposed that cgi & cgitb should be removed. I suspect I am not the only person in the world that likes using cgi and cgitb. Can I second this? I just started writing a small CGI application in Python, and if cgi and cgitb

PEP 594 cgi & cgitb removal

2019-05-22 Thread Robin Becker
In PEP 594 t has been proposed that cgi & cgitb should be removed. I suspect I am not the only person in the world that likes using cgi and cgitb. One of the nice features in cgitb is the ability to get a nice traceback with variable values etc etc etc. I have used the underlying mechanis

Re: Processing multiple forms in a cgi script

2016-02-19 Thread Jeremy Leonard
On Friday, February 19, 2016 at 1:18:41 PM UTC-5, Jon Ribbens wrote: > On 2016-02-19, Jeremy Leonard wrote: > > I have a quick question regarding processing multiple forms. Most of > > my experience has been where there is just one form so the logic was > > pretty straight forward for me. My questi

Re: Processing multiple forms in a cgi script

2016-02-19 Thread Grant Edwards
On 2016-02-19, Jon Ribbens wrote: > On 2016-02-19, Jeremy Leonard wrote: > >> I have a quick question regarding processing multiple forms. Most >> of my experience has been where there is just one form so the logic >> was pretty straight forward for me. My question revolves around how >> to handl

Re: Processing multiple forms in a cgi script

2016-02-19 Thread Jon Ribbens
On 2016-02-19, Jeremy Leonard wrote: > I have a quick question regarding processing multiple forms. Most of > my experience has been where there is just one form so the logic was > pretty straight forward for me. My question revolves around how to > handle multiple forms. I've seen that you can ha

Processing multiple forms in a cgi script

2016-02-19 Thread Jeremy Leonard
I have a quick question regarding processing multiple forms. Most of my experience has been where there is just one form so the logic was pretty straight forward for me. My question revolves around how to handle multiple forms. I've seen that you can have an id for each form, but I'm unsure how

Re: CGI

2015-12-27 Thread Chris Warrick
On 27 December 2015 at 18:59, Laurent Delacroix wrote: > On 26/12/15 10:41, Pol Hallen wrote: >> >> How can I execute a local command (like ls or similar) and show output >> via browser? >> > > Either you use a proper web framework (Flask, Bottle, Django in order of > complexity) or you set up a w

Re: CGI

2015-12-27 Thread Laurent Delacroix
On 26/12/15 10:41, Pol Hallen wrote: > > How can I execute a local command (like ls or similar) and show output > via browser? > Either you use a proper web framework (Flask, Bottle, Django in order of complexity) or you set up a web server with FastCGI support (e.g. nginx) and run a WSGI appli

Re: CGI

2015-12-27 Thread Maitu Zentz
Pol Hallen: > Merry Christmas to all :-) > > A (newbie) question: I'd like learn about CGI pyhton script to create > some utility using http://localhost/python_script01.py > > Something like that: > > #!/usr/bin/python print "Content-type: text/html" &g

Re: CGI

2015-12-27 Thread Chris Angelico
On Sat, Dec 26, 2015 at 7:35 AM, Pol Hallen wrote: > Merry Christmas to all :-) > > A (newbie) question: I'd like learn about CGI pyhton script to create some > utility using http://localhost/python_script01.py > > Something like that: > > #!/usr/bin/python >

CGI

2015-12-27 Thread Pol Hallen
Merry Christmas to all :-) A (newbie) question: I'd like learn about CGI pyhton script to create some utility using http://localhost/python_script01.py Something like that: #!/usr/bin/python print "Content-type: text/html" print print "" print "Hello!"

CGI

2015-12-27 Thread Pol Hallen
Merry Christmas to all :-) A (newbie) question: I'd like learn about CGI pyhton script to create some utility using http://localhost/python_script01.py Something like that: #!/usr/bin/python print "Content-type: text/html" print print "" print "Hello!"

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread Chris Angelico
On Tue, Sep 22, 2015 at 7:36 AM, wrote: > Thank you very much. Can I write .py pages like in PHP or should I > use a framework like Django, Web2py or TurboGears? I recommend using WSGI and a framework that uses it (my personal preference is Flask, but the above will also work). Here are a couple

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread tropical . dude . net
"The Gashlycrumb > >> > Tinies" > >> > >> I am new to Ubuntu, is there a command so I can find out what the > >> problem is? > > > > The only error I can see right now is forbedden, you don't have >

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread alister
oblem is? > > The only error I can see right now is forbedden, you don't have > permission to access /index.py on this server. this is not a linux permissions error it is an error with the apache configuration you need to check roe acache config files (you may also want to investigate WSGI as CGI is outdated) -- Perfection is acheived only on the point of collapse. - C. N. Parkinson -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread tropical . dude . net
On Monday, September 21, 2015 at 9:47:33 PM UTC+2, tropical...@gmail.com wrote: > On Monday, September 21, 2015 at 9:41:29 PM UTC+2, John Gordon wrote: > > In <44e870a7-9567-40ba-8a65-d6b52a8c5...@googlegroups.com> > > tropical.dude@gmail.com writes: > > > > > print("Content-Type: text/html;c

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread tropical . dude . net
On Monday, September 21, 2015 at 9:41:29 PM UTC+2, John Gordon wrote: > In <44e870a7-9567-40ba-8a65-d6b52a8c5...@googlegroups.com> > tropical.dude@gmail.com writes: > > > print("Content-Type: text/html;charset=utf-8") > > print("Hello World!") > > As I recall, you must have a blank line betw

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread tropical . dude . net
On Monday, September 21, 2015 at 9:30:11 PM UTC+2, Albert Visser wrote: > On Mon, 21 Sep 2015 20:41:13 +0200, wrote: > > > Hello everybody, > > > (...) > > > > I created index.py: > > #!/usr/bin/env python > > # -*- coding: UTF-8 -*-# enable debugging > > import cgitb > > > > cgitb.enable() > > p

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread John Gordon
In <44e870a7-9567-40ba-8a65-d6b52a8c5...@googlegroups.com> tropical.dude@gmail.com writes: > print("Content-Type: text/html;charset=utf-8") > print("Hello World!") As I recall, you must have a blank line between the headers and the content. But that may or may not be your problem, as you ha

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread tropical . dude . net
nfiguring Apache to run python CGI scripts. > > > > I ran: > > sudo a2enmod cgi > > > > I added to apache2.conf > > > > Options +ExecCGI > > AddHandler cgi-script .py > > > > > > I created index.py: > > #!/u

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread Albert Visser
On Mon, 21 Sep 2015 20:41:13 +0200, wrote: Hello everybody, (...) I created index.py: #!/usr/bin/env python # -*- coding: UTF-8 -*-# enable debugging import cgitb cgitb.enable() print("Content-Type: text/html;charset=utf-8") print("Hello World!") But it is still not working. Can anybody

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread sohcahtoa82
On Monday, September 21, 2015 at 11:41:54 AM UTC-7, tropical...@gmail.com wrote: > Hello everybody, > > I installed the LAMP stack on in Ubuntu, but I am having > problems configuring Apache to run python CGI scripts. > > I ran: > sudo a2enmod cgi > &

Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread tropical . dude . net
Hello everybody, I installed the LAMP stack on in Ubuntu, but I am having problems configuring Apache to run python CGI scripts. I ran: sudo a2enmod cgi I added to apache2.conf Options +ExecCGI AddHandler cgi-script .py I created index.py: #!/usr/bin/env python # -*- coding

Re: 404 Error when using local CGI Server

2015-06-25 Thread Chris Angelico
On Thu, Jun 25, 2015 at 3:48 AM, Charles Carr wrote: > I am running a local cgi server from python on a windows 7 computer. > Whenever I try to serve the output of a cgi file by entering the following > into my browser: http://localhost:8080/filename.py , I get a 404 error > message t

404 Error when using local CGI Server

2015-06-25 Thread Charles Carr
I am running a local cgi server from python on a windows 7 computer. Whenever I try to serve the output of a cgi file by entering the following into my browser: http://localhost:8080/filename.py , I get a 404 error message that the file was not found. I'm positive that the files I am tryi

Re: cgi parse_qs still exists?

2015-03-30 Thread Mark Lawrence
On 30/03/2015 07:48, dieter wrote: Mark Lawrence writes: This has been marked for deprecation since at least 2.6 but is still in the 3.5 code base. Does anybody know if this is by accident or design? If the former I'll happily raise an issue to get it removed unless somebody beats me to it.

Re: cgi parse_qs still exists?

2015-03-29 Thread dieter
Mark Lawrence writes: > This has been marked for deprecation since at least 2.6 but is still > in the 3.5 code base. Does anybody know if this is by accident or > design? If the former I'll happily raise an issue to get it removed > unless somebody beats me to it. I am using "cgi.parse_qs" - an

cgi parse_qs still exists?

2015-03-29 Thread Mark Lawrence
This has been marked for deprecation since at least 2.6 but is still in the 3.5 code base. Does anybody know if this is by accident or design? If the former I'll happily raise an issue to get it removed unless somebody beats me to it. -- My fellow Pythonistas, ask not what our language can d

Re: Unicode in cgi-script with apache2

2014-08-17 Thread Peter Otten
Dominique Ramaekers wrote: > And if I check the encoding with the python script (uncommenting line > #1), I still get ANSI_X3.4-1968 That should not matter as long as print(os.environ.get("PYTHONIOENCODING")) prints UTF-8 If you do get the correct PYTHONIOENCODING you should be able to replac

Re: Unicode in cgi-script with apache2

2014-08-17 Thread Peter Otten
Dominique Ramaekers wrote: > As I suspected, if I check the used encoding in wsgi I get: > ANSI_X3.4-1968 > > I found you can define the coding of the script with a special comment: > # -*- coding: utf-8 -*- > > Now I don't get an error but my special chars still doesn't display well. > The scri

Re: Unicode in cgi-script with apache2

2014-08-17 Thread Steven D'Aprano
1') 'Hello World! é ü Ã\xa0 Å©' which appears to be exactly what you have. Why Latin-1 instead of ASCII? Because the process has to output *something*, and Latin-1 is sometimes called "extended ASCII". I'm starting to fear a bug in Python 3.4, but since I have almost no knowledge about wsgi and cgi, I can't be sure that this isn't just normal expected behaviour :-( -- Steven -- https://mail.python.org/mailman/listinfo/python-list

Re: Unicode in cgi-script with apache2

2014-08-17 Thread Mark Lawrence
On 17/08/2014 13:02, Dominique Ramaekers wrote: if style == TOP_POSTING: *plonk* -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Unicode in cgi-script with apache2

2014-08-17 Thread Dominique Ramaekers
As I suspected, if I check the used encoding in wsgi I get: ANSI_X3.4-1968 I found you can define the coding of the script with a special comment: # -*- coding: utf-8 -*- Now I don't get an error but my special chars still doesn't display well. The script: # -*- coding: utf-8 -*- import sys de

Re: Unicode in cgi-script with apache2

2014-08-17 Thread Dominique Ramaekers
Yes, even a restart not just reload. I Also put it in the section as in the main apache2.conf Op 17-08-14 om 13:04 schreef Peter Otten: Dominique Ramaekers wrote: Putting the lines in my apache config: AddDefaultCharset UTF-8 SetEnv PYTHONIOENCODING utf-8 Cleared my brower-cache... No c

Re: Unicode in cgi-script with apache2

2014-08-17 Thread Peter Otten
Dominique Ramaekers wrote: > Putting the lines in my apache config: > AddDefaultCharset UTF-8 > SetEnv PYTHONIOENCODING utf-8 > > Cleared my brower-cache... No change. Did you restart the apache? -- https://mail.python.org/mailman/listinfo/python-list

Re: Unicode in cgi-script with apache2

2014-08-17 Thread Dominique Ramaekers
Wow, everybody keeps on chewing on this problem. As a bonus, I've reconfigured my server to do some testings. http://cloudserver.ramaekers-stassart.be/test.html => is the file I want to read. Going to this url displays the file... http://cloudserver.ramaekers-stassart.be/cgi-python/e

Re: Unicode in cgi-script with apache2

2014-08-17 Thread Steven D'Aprano
lem is *reading* the file, not printing: [Sat Aug 16 23:12:42.158326 2014] [cgi:error] [pid 29327] [client 119.63.193.196:0] AH01215: Traceback (most recent call last): [Sat Aug 16 23:12:42.158451 2014] [cgi:error] [pid 29327] [client 119.63.193.196:0] AH01215: File "/var/www/cgi-python/

Re: Unicode in cgi-script with apache2

2014-08-16 Thread Steven D'Aprano
Dominique Ramaekers wrote: [...] > 2) Your tip, to use 'encode' did not solve the problem and created a new > one. My lines were incapsulted in quotes and I got a lot of \b's and > \n's... and I still got the same error. Just throwing random encode/decode calls into the mix are unlikely to fix th

Re: Unicode in cgi-script with apache2

2014-08-16 Thread Dominique Ramaekers
set available to stdout of the spawned process. From your other message, the error appears to be a python error on reading the input file. For some reason python seems to be trying to interpret the file it is reading as ascii. I wonder if specifying the binary data parameter and / or utf-8 encodin

Re: Unicode in cgi-script with apache2

2014-08-16 Thread Denis McMahon
data parameter and / or utf-8 encoding when opening the file might help. eg: f = open( "/var/www/cgi-data/index.html", "rb" ) f = open( "/var/www/cgi-data/index.html", "rb", encoding="utf-8" ) f = open( "/var/www/cgi-data/index.html",

Re: Unicode in cgi-script with apache2

2014-08-16 Thread Dominique Ramaekers
] [client 119.63.193.196:0] AH01215: File "/var/www/cgi-python/index.html", line 12, in [Sat Aug 16 23:12:42.158473 2014] [cgi:error] [pid 29327] [client 119.63.193.196:0] AH01215: for line in f: [Sat Aug 16 23:12:42.158526 2014] [cgi:error] [pid 29327] [client 119.63.193

Re: Unicode in cgi-script with apache2

2014-08-16 Thread Dominique Ramaekers
y use en_US.UTF-8 (and not ex. nl_BE.UTF8)... Anyway, It didn't work for me. And I find this a dirty fix because, I don't want to use US locale... Please excuse me not to try out your specific solutions. I've already started to implement WSGI over CGI. See my previous message... grz

Re: Unicode in cgi-script with apache2

2014-08-16 Thread Dominique Ramaekers
eef John Gordon: In Dominique Ramaekers writes: #!/usr/bin/env python3 print("Content-Type: text/html") print("Cache-Control: no-cache, must-revalidate")# HTTP/1.1 print("Expires: Sat, 26 Jul 1997 05:00:00 GMT") # Date in the past print("")

Re: Unicode in cgi-script with apache2

2014-08-16 Thread Dominique Ramaekers
I fond my problem, I will describe it more at the bottom of this message... But first... Thanks Alister for the tips: 1) This evening, I've researched WSGI. I found that WSGI is more advanced than CGI and I also think WSGI is more the Python way. I'm an amateur playing arou

Re: Unicode in cgi-script with apache2

2014-08-16 Thread Denis McMahon
On Fri, 15 Aug 2014 20:10:25 +0200, Dominique Ramaekers wrote: > #!/usr/bin/env python3 > print("Content-Type: text/html") > print("Cache-Control: no-cache, must-revalidate")# HTTP/1.1 > print("Expires: Sat, 26 Jul 1997 05:00:00 GMT") # Date in the

Re: Unicode in cgi-script with apache2

2014-08-16 Thread Peter Otten
Dominique Ramaekers wrote: > I've got a little script: > > #!/usr/bin/env python3 > print("Content-Type: text/html") > print("Cache-Control: no-cache, must-revalidate")# HTTP/1.1 > print("Expires: Sat, 26 Jul 1997 05:00:00 GMT") # Date

Re: Unicode in cgi-script with apache2

2014-08-15 Thread John Gordon
In Dominique Ramaekers writes: > #!/usr/bin/env python3 > print("Content-Type: text/html") > print("Cache-Control: no-cache, must-revalidate")# HTTP/1.1 > print("Expires: Sat, 26 Jul 1997 05:00:00 GMT") # Date in the past > print(""

Re: Unicode in cgi-script with apache2

2014-08-15 Thread alister
Sat, 26 Jul 1997 05:00:00 GMT") # Date in the past > print("") > f = open("/var/www/cgi-data/index.html", "r") > for line in f: > print(line,end='') > > If I run the script in the terminal, it nicely prints the webpage > &#x

Unicode in cgi-script with apache2

2014-08-15 Thread Dominique Ramaekers
Hi, I've got a little script: #!/usr/bin/env python3 print("Content-Type: text/html") print("Cache-Control: no-cache, must-revalidate")# HTTP/1.1 print("Expires: Sat, 26 Jul 1997 05:00:00 GMT") # Date in the past print("") f = open("

Re: Execute a python script with CGI ?

2014-06-27 Thread dandrigo
: -- DocumentRoot "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\cgi-bin" AddHandler cgi-script .cgi .py *i created a htacess.txt and i

Re: Execute a python script with CGI ?

2014-06-26 Thread Ian Kelly
rver : > Apache;OS : Linux). > > How to write a CGI template please? > > Could you throw light for me? > > Thank you very much. > > Regards. While you can run Python as a CGI, the recommended pattern is to use WSGI. I suggest starting here: https://docs.python.org/2/howt

Re: Execute a python script with CGI ?

2014-06-26 Thread gregor
server : Apache;OS : Linux). > > How to write a CGI template please? > > Could you throw light for me? https://docs.python.org/2/library/cgi.html -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Execute a python script with CGI ?

2014-06-26 Thread dandrigo
Dear all, I coded a python script (web service with query postgresql/postgis). Up to now, i did several test on my local laptop station (windows). Now i want to execute this python script on our remote server (Web server : Apache;OS : Linux). How to write a CGI template please? Could you

Re: WSGI (was: Re: Python CGI)

2014-05-25 Thread alister
On Sun, 25 May 2014 09:06:18 +0200, Chris wrote: > On 05/20/2014 03:52 AM, Tim Chase wrote: >> While Burak addressed your (Fast-)CGI issues, once you have a >> test-script successfully giving you output, you can use the >> standard-library's getpass.getuser() functi

WSGI (was: Re: Python CGI)

2014-05-25 Thread Chris
On 05/20/2014 03:52 AM, Tim Chase wrote: > While Burak addressed your (Fast-)CGI issues, once you have a > test-script successfully giving you output, you can use the > standard-library's getpass.getuser() function to tell who your script > is running as. LoadModule ws

WSGI (was: Re: Python CGI)

2014-05-25 Thread Christian
On 05/20/2014 03:52 AM, Tim Chase wrote: > While Burak addressed your (Fast-)CGI issues, once you have a > test-script successfully giving you output, you can use the > standard-library's getpass.getuser() function to tell who your script > is running as. LoadModule ws

Re: Python CGI

2014-05-19 Thread Tim Chase
On 2014-05-19 20:32, Christian wrote: > I'd like to use Python for CGI-Scripts. Is there a manual how to > setup Python with Fast-CGI? I'd like to make sure that Python > scripts aren't executed by www-user, but the user who wrote the > script. While Burak addressed y

Re: Python CGI

2014-05-19 Thread Burak Arslan
On 05/19/14 21:32, Christian wrote: > Hi, > > I'd like to use Python for CGI-Scripts. Is there a manual how to setup > Python with Fast-CGI? Look for Mailman fastcgi guides. Here's one for gentoo, but I imagine it'd be easily applicable to other disros: https://www.

Python CGI

2014-05-19 Thread Christian
Hi, I'd like to use Python for CGI-Scripts. Is there a manual how to setup Python with Fast-CGI? I'd like to make sure that Python scripts aren't executed by www-user, but the user who wrote the script. -- Gruß, Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: What's wrong?New hand.chapter7/8 webapp -No such CGI script

2013-11-22 Thread 曹守正
在 2013年11月22日星期五UTC+8下午4时48分35秒,曹守正写道: > My webapp is once good to use. Now I do not know what happened. It can not > work. > > when i type http://localhost:8080/cgi-bin/generate_list.py , > http://localhost:8080/cgi-bin/generate_timing_data.py, or anything after > cgi-bin in

What's wrong?New hand.chapter7/8 webapp -No such CGI script

2013-11-22 Thread 曹守正
My webapp is once good to use. Now I do not know what happened. It can not work. when i type http://localhost:8080/cgi-bin/generate_list.py , http://localhost:8080/cgi-bin/generate_timing_data.py, or anything after cgi-bin in my chrome. It all turns out like Message: No such CGI script ('

Re: How to exit a cgi file after a download

2013-09-05 Thread inq1ltd
There is no such thing as a "cgi form" or "cgi window". Your cgi script runs when the user requests a Web page, generates a page, and then ends. At that point, python has stopped running. If your want the client's browser window to close, that's not a python prob

Re: How to exit a cgi file after a download.

2013-09-04 Thread alex23
On 5/09/2013 5:42 AM, Joel Goldstick wrote: This same message comes up under one of Niko's many aliases. Is this another? Why post twice? Because he's a troll. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to exit a cgi file after a download

2013-09-04 Thread Benjamin Kaplan
On Sep 4, 2013 1:29 PM, "Ferrous Cranus" wrote: > > Python help. > > I use the following code in a cgi file > to give the client a download link to > download a file. > > --- > > print "%s" % (' Down > Load ') > > > &

Re: How to exit a cgi file after a download

2013-09-04 Thread random832
On Wed, Sep 4, 2013, at 12:49, Ferrous Cranus wrote: > Without closing it, the client can download > again and forever if they choose to because > the cgi window is open and the link is still > active. Why is this a problem? They usually won't want to, and if they do want t

Re: How to exit a cgi file after a download.

2013-09-04 Thread Joel Goldstick
This same message comes up under one of Niko's many aliases. Is this another? Why post twice? On Wed, Sep 4, 2013 at 2:44 PM, inq1ltd wrote: > Python help. > > I use the following code in a cgi file > to give the client a download link to > download a file. > > --

How to exit a cgi file after a download.

2013-09-04 Thread inq1ltd
Python help. I use the following code in a cgi file to give the client a download link to download a file. --- print "%s" % (' Down Load ') A click on "Down Load" opens a pop up browser window which allows the user to choose where to download the &qu

How to exit a cgi file after a download

2013-09-04 Thread Ferrous Cranus
Python help. I use the following code in a cgi file to give the client a download link to download a file. --- print "%s" % (' Down Load ') A click on "Down Load" opens a pop up browser window which allows the user to choose where to download the &qu

Re: Data transfer from Python CGI to javascript

2013-08-09 Thread MRAB
On 09/08/2013 07:53, e...@cleantechsolution.in wrote: I have written the following program #!c:\Python27\Python.exe import cgi, cgitb; import sys, serial cgitb.enable() ser = serial.Serial('COM27', 9600) myvar = ser.readline() print "Content-type:text/html\n\n" print "&q

Data transfer from Python CGI to javascript

2013-08-09 Thread engg
I have written the following program #!c:\Python27\Python.exe import cgi, cgitb; import sys, serial cgitb.enable() ser = serial.Serial('COM27', 9600) myvar = ser.readline() print "Content-type:text/html\n\n" print """ Real Time Temperature window.o

Re: Persistence of CGI (was: OSError [Errno 26] ?!?!)

2013-07-02 Thread Tim Chase
On 2013-07-03 00:19, Steven D'Aprano wrote: > CGI didn't stop working just because more powerful, or better, > alternatives now exist. And for most exceptionally cheap hosting services, your choices are usually limited to PHP, static HTML (possibly server-side includes if you&#

Re: Making a pass form cgi => webpy framework

2013-06-28 Thread rusi
On Friday, June 28, 2013 3:45:27 PM UTC+5:30, Νίκος wrote: > Στις 28/6/2013 12:35 μμ, ο/η Robert Kern έγραψε: > I see, your explanation started to make things clearer to me. > What is the easiest and simplest web framework you advise me to use? > Here's a picture of the web-development scene as I

Re: Making a pass form cgi => webpy framework

2013-06-28 Thread Robert Kern
On 2013-06-28 11:15, Νίκος wrote: Στις 28/6/2013 12:35 μμ, ο/η Robert Kern έγραψε: On 2013-06-28 04:38, Νίκος wrote: Στις 28/6/2013 2:08 πμ, ο/η Cameron Simpson έγραψε: Pick a simple framework or templating engine and try it. I have no recommendations to make in this area myself. Can you e

Re: Making a pass form cgi => webpy framework

2013-06-28 Thread Νίκος
Στις 28/6/2013 12:35 μμ, ο/η Robert Kern έγραψε: On 2013-06-28 04:38, Νίκος wrote: Στις 28/6/2013 2:08 πμ, ο/η Cameron Simpson έγραψε: Pick a simple framework or templating engine and try it. I have no recommendations to make in this area myself. Can you explain to me the difference of the

Re: Making a pass form cgi => webpy framework

2013-06-28 Thread Robert Kern
On 2013-06-28 04:38, Νίκος wrote: Στις 28/6/2013 2:08 πμ, ο/η Cameron Simpson έγραψε: Pick a simple framework or templating engine and try it. I have no recommendations to make in this area myself. Can you explain to me the difference of the former and latter? A templating engine takes you

Re: Making a pass form cgi => webpy framework

2013-06-27 Thread Νίκος
Στις 28/6/2013 2:08 πμ, ο/η Cameron Simpson έγραψε: On 27Jun2013 16:32, Νίκος wrote: | a) keep my existing Python cgi way that embed print ''' statements | within python code to displays mostly tables? I'd argue against this approach. Like hand constructing SQL, this is r

Re: Making a pass form cgi => webpy framework

2013-06-27 Thread Cameron Simpson
On 27Jun2013 16:32, Νίκος wrote: | a) keep my existing Python cgi way that embed print ''' statements | within python code to displays mostly tables? I'd argue against this approach. Like hand constructing SQL, this is rife with opportunity to make syntax errors, either o

Re: Making a pass form cgi => webpy framework

2013-06-27 Thread Νίκος
all its only one html table i wish to display. Good question. Sometimes your way is best. The main advantage of using templates is that the template contains only html (mostly) and the cgi code contains only python (mostly). The idea is that you can look at the template and see only the kind

Re: Making a pass form cgi => webpy framework

2013-06-25 Thread Νίκος
ing i really dont seem to even have a lcue of what i web framework is and how it si compred to python cgi or to other templating systems(mako) I mean if its htere to make my life and scripts easier to maintain then i should use it, but if its gonna make my scripts more compilcated then i dont wi

Re: Making a pass form cgi => webpy framework

2013-06-25 Thread Joel Goldstick
py script) ? > > After all its only one html table i wish to display. > > Good question. Sometimes your way is best. > > The main advantage of using templates is that the template contains > only html (mostly) and the cgi code contains only python (mostly). > > The idea

  1   2   3   4   5   6   7   8   9   10   >