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: 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
Dominique Ramaekers wrote: > As I suspected, if I check the used encoding in wsgi I get: > ANSI_X3.4-1968 That's another name for ASCII. > I found you can define the coding of the script with a special comment: > # -*- coding: utf-8 -*- Be careful. That just tells Python what encoding the sour

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
ncoding1 => is the cgi-script of this test http://cloudserver.ramaekers-stassart.be/wsgi => is the wsgi sollution (but for now it just says 'Hello world'...) This configuration- dominique@cloudserver:/var/www/cgi-python$ cat /etc/default/

Re: Unicode in cgi-script with apache2

2014-08-17 Thread Steven D'Aprano
Denis McMahon wrote: > 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. Oh!!! /facepalm I think you've got it. I've been assuming the problem was on *writing* the

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
* My system is a linux-box. * I've tried using encoding="utf-8". It didn't fix things. * That print uses sys.stdout would explain, using sys.stdout isn't better. * My locale and the system-wide locale is UTF-8. Using SetEnv PYTHONIOENCODING utf-8 didn't fix things * The file is encoded UTF-8

Re: Unicode in cgi-script with apache2

2014-08-16 Thread Denis McMahon
On Sun, 17 Aug 2014 00:36:14 +0200, Dominique Ramaekers wrote: > What seems to be the problem: > My Script was ok. I know this because in the terminal I got my expected > output. Python3 uses UTF-8 coding as a standard. The problem is, when > python 'prints' to the apache interface, it translates

Re: Unicode in cgi-script with apache2

2014-08-16 Thread Dominique Ramaekers
Hi Denis, This error is a python error displayed in the apache error log. The complete message is: [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] [clien

Re: Unicode in cgi-script with apache2

2014-08-16 Thread Dominique Ramaekers
Hi Peter, Your code seems interesting. I've tried using sys.stdout (in a slightly different form) but it gave the same error. I also read about people who fixed the error by changing the servers locale to en_US.UTF-8. The people who posted these fixes also said that you can only use en_US.U

Re: Unicode in cgi-script with apache2

2014-08-16 Thread Dominique Ramaekers
Hi John, The error is in the line "print(line,end='')"... and it only happens when the script is started from a webbrowser. In the terminal, the script works fine. See my previous mail for my findings after a lot of reading and trying... grz Op 15-08-14 om 21:32 schreef John Gordon: In D

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 around with my imaginati

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 past > print("") > f = open("/var/www/cgi-dat

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 in the past > print("") > f = open("/var/www/cgi-data/ind

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("") > f = open("/var/www/cgi-data/index.html", "r") > for lin

Re: Unicode in cgi-script with apache2

2014-08-15 Thread alister
On Fri, 15 Aug 2014 20:10:25 +0200, Dominique Ramaekers wrote: > 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 >

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("/var/www/cgi-data/index.html", "r") for line in f: prin

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

2013-11-22 Thread 曹守正
my chrome. It all turns out like Message: No such CGI script > ('/cgi-bin/generate_timing_data.py'). Error code explanation: 404 - Nothing > matches the given URI. > > I even download the webapp on http://www.headfirstlabs.com/books/hfpython/ > > Still it does n

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: Errin when executing a cgi script that sets a cookie in the browser

2013-06-09 Thread Νικόλαος Κούρας
Τη Κυριακή, 9 Ιουνίου 2013 8:27:53 π.μ. UTC+3, ο χρήστης nagia@gmail.com έγραψε: > Trying > > > > yum install dos2unix > > > > and > > > > root@nikos [/home/nikos/www/cgi-bin]# dos2unix koukos.py > > dos2unix: converting file koukos.py to UNIX format ... > > > > > > Then brows

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-08 Thread nagia . retsina
Trying yum install dos2unix and root@nikos [/home/nikos/www/cgi-bin]# dos2unix koukos.py dos2unix: converting file koukos.py to UNIX format ... Then browsed to the page again in Chrome it worked as expected :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-08 Thread Chris Angelico
On Sun, Jun 9, 2013 at 2:56 AM, Νικόλαος Κούρας wrote: > Τη Σάββατο, 8 Ιουνίου 2013 7:03:57 μ.μ. UTC+3, ο χρήστης Chris Angelico > έγραψε: >> On Sun, Jun 9, 2013 at 1:36 AM, Νικόλαος Κούρας >> wrote: > >> > Well, www as symlink to public_html is always a symlink to any system i >> > have used s

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-08 Thread Νικόλαος Κούρας
Τη Κυριακή, 9 Ιουνίου 2013 12:17:16 π.μ. UTC+3, ο χρήστης Michael Torrie έγραψε: > > What does this error means anyway? > It means that Apache is unable to find your cgi script. It's turning > the url into a file path, but it can't find the file path. Sometimes > Ap

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-08 Thread Michael Torrie
It means that Apache is unable to find your cgi script. It's turning the url into a file path, but it can't find the file path. Sometimes Apache is configured to not follow symlinks. It's confusing too because you have two apaches installed. The system default one and the

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-08 Thread Νικόλαος Κούρας
Τη Σάββατο, 8 Ιουνίου 2013 7:03:57 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Sun, Jun 9, 2013 at 1:36 AM, Νικόλαος Κούρας wrote: > > Well, www as symlink to public_html is always a symlink to any system i > > have used so its something defaulted. > It's most certainly not the default, it

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-08 Thread Chris Angelico
On Sun, Jun 9, 2013 at 1:36 AM, Νικόλαος Κούρας wrote: > Τη Σάββατο, 8 Ιουνίου 2013 10:01:51 π.μ. UTC+3, ο χρήστης Chris Angelico > έγραψε: >> On Sat, Jun 8, 2013 at 4:53 PM, Νικόλαος Κούρας >> wrote: >> >> > Τη Παρασκευή, 7 Ιουνίου 2013 11:47:58 μ.μ. UTC+3, ο χρήστης MRAB έγραψε: >> >> >> On 0

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-08 Thread Νικόλαος Κούρας
Τη Σάββατο, 8 Ιουνίου 2013 10:01:51 π.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Sat, Jun 8, 2013 at 4:53 PM, Νικόλαος Κούρας wrote: > > > Τη Παρασκευή, 7 Ιουνίου 2013 11:47:58 μ.μ. UTC+3, ο χρήστης MRAB έγραψε: > > >> On 07/06/2013 19:24, Νικόλαος Κούρας wrote: > > \>> > Τη Παρασκευή, 7 Ι

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-08 Thread Chris Angelico
On Sat, Jun 8, 2013 at 4:53 PM, Νικόλαος Κούρας wrote: > Τη Παρασκευή, 7 Ιουνίου 2013 11:47:58 μ.μ. UTC+3, ο χρήστης MRAB έγραψε: >> On 07/06/2013 19:24, Νικόλαος Κούρας wrote: \>> > Τη Παρασκευή, 7 Ιουνίου 2013 5:32:09 μ.μ. UTC+3, ο χρήστης MRAB έγραψε: >> >> It's looking for '/home/nikos/public_

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-07 Thread Νικόλαος Κούρας
Τη Παρασκευή, 7 Ιουνίου 2013 11:47:58 μ.μ. UTC+3, ο χρήστης MRAB έγραψε: > On 07/06/2013 19:24, Νικόλαος Κούρας wrote: > > > Τη Παρασκευή, 7 Ιουνίου 2013 5:32:09 μ.μ. UTC+3, ο χρήστης MRAB έγραψε: > > >>>Can find what? koukos.py is there inside the cg-bin dir with 755 perms. > > > > > >> It's l

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-07 Thread MRAB
On 07/06/2013 19:24, Νικόλαος Κούρας wrote: Τη Παρασκευή, 7 Ιουνίου 2013 5:32:09 μ.μ. UTC+3, ο χρήστης MRAB έγραψε: Can find what? koukos.py is there inside the cg-bin dir with 755 perms. It's looking for '/home/nikos/public_html/cgi-bin/koukos.py'. Its looking for its self?!?! Have a loo

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-07 Thread Νικόλαος Κούρας
Τη Παρασκευή, 7 Ιουνίου 2013 5:32:09 μ.μ. UTC+3, ο χρήστης MRAB έγραψε: >>Can find what? koukos.py is there inside the cg-bin dir with 755 perms. > It's looking for '/home/nikos/public_html/cgi-bin/koukos.py'. Its looking for its self?!?! > Have a look in '/home/nikos/public_html/cgi-bin'. Is 'k

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-07 Thread MRAB
On 07/06/2013 08:51, Νικόλαος Κούρας wrote: Finally no suexec erros any more after chown all log files to nobody:nobody and thei corresponding paths. Now the error has been transformed to: [Fri Jun 07 10:48:47 2013] [error] [client 79.103.41.173] (2)No such file or directory: exec of '/home/

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-07 Thread Νικόλαος Κούρας
Finally no suexec erros any more after chown all log files to nobody:nobody and thei corresponding paths. Now the error has been transformed to: [Fri Jun 07 10:48:47 2013] [error] [client 79.103.41.173] (2)No such file or directory: exec of '/home/nikos/public_html/cgi-bin/koukos.py' failed [F

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-07 Thread Νικόλαος Κούρας
Any other ideas guys? I can output for you any command you ask me too, so you have a better understanding about this suexec thing. I have checked the path to the error log file too, it's not just enough that the file is accessible for a user, the whole path to the file needs to have the right

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-06 Thread Lele Gaifax
Skip Montanaro writes: > He will get an extra blank line, since he added a newline character at > the end of his Content-Type string. Right, missed that, sorry for the noise. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad a

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-06 Thread Νικόλαος Κούρας
Something else i need to try so for 'suexec' to be able to open its own lof file? What a weird error that is. An Apache's extension that can open its own log file. -- http://mail.python.org/mailman/listinfo/python-list

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-06 Thread Skip Montanaro
> Did you tried running that by a standalone Python interpreter? Did you > notice something strange, something like that an empty line is missing > between headers and body? He will get an extra blank line, since he added a newline character at the end of his Content-Type string. Skip -- http://

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-06 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 10:26:08 μ.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε: > Did you tried running that by a standalone Python interpreter? Did you > notice something strange, something like that an empty line is missing > between headers and body? No, nothing at all. Two '/n/n' are not requi

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-06 Thread Lele Gaifax
Νικόλαος Κούρας writes: > I have re-enabled 'suexec' and set cgi as default phphandler and then trying: > > print( cookie ) > print( '''Content-type: text/html; charset=utf-8\n''' ) > print( message ) Did you tried running that by a standalone Python interpreter? Did you notice something strange

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-06 Thread Νικόλαος Κούρας
Since cPanel is in charge of apache i ahve even: chown nobody:nobody to both of the suexec logs. ni...@superhost.gr [~/www/cgi-bin]# ls -l /usr/local/apache/logs/suexec_log -rw-rw-r-- 1 nobody nobody 675389 Jun 6 22:05 /usr/local/apache/logs/suexec_log ni...@superhost.gr [~/www/cgi-bin]# ls -l /

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-06 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 9:40:04 μ.μ. UTC+3, ο χρήστης ru...@yahoo.com έγραψε: > On 06/06/2013 04:53 AM, Νικόλαος Κούρας wrote:> I have re-enabled 'suexec' > and set cgi as default phphandler and then trying: > > > > > > print( cookie ) > > > print( '''Content-type: text/html; charset=utf-8\n

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-06 Thread rurpy
On 06/06/2013 04:53 AM, Νικόλαος Κούρας wrote:> I have re-enabled 'suexec' and set cgi as default phphandler and then trying: > > print( cookie ) > print( '''Content-type: text/html; charset=utf-8\n''' ) > print( message ) > > - > ni...@superhost.gr [~/www/data/ap

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-06 Thread Νικόλαος Κούρας
I have re-enabled 'suexec' and set cgi as default phphandler and then trying: print( cookie ) print( '''Content-type: text/html; charset=utf-8\n''' ) print( message ) - ni...@superhost.gr [~/www/data/apps]# [Thu Jun 06 13:51:28 2013] [error] [client 79.103.41.173]

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread Νικόλαος Κούρας
root@nikos [~]# chmod 755 /var/log root@nikos [~]# chmod 755 /var/log/httpd root@nikos [~]# chmod 666 /var/log/httpd/suexec.log root@nikos [~]# chmod 755 /usr/local/apache root@nikos [~]# chmod 755 /usr/local/apache/logs/ root@nikos [~]# chmod 666 /usr/local/apache/logs/error_log and then execut

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 1:21:08 π.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Thu, Jun 6, 2013 at 7:18 AM, wrote: > > > On Wednesday, June 5, 2013 3:03:29 PM UTC-6, Chris Angelico wrote: > > >> On Thu, Jun 6, 2013 at 6:56 AM, wrote: > > >> > On Wednesday, June 5, 2013 1:54:45 PM UTC-6,

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 12:18:39 π.μ. UTC+3, ο χρήστης ru...@yahoo.com έγραψε: > On Wednesday, June 5, 2013 3:03:29 PM UTC-6, Chris Angelico wrote: > > > On Thu, Jun 6, 2013 at 6:56 AM, wrote: > > > > On Wednesday, June 5, 2013 1:54:45 PM UTC-6, Νικόλαος Κούρας wrote: > > > >>... > > > >> p

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread Cameron Simpson
On 05Jun2013 14:18, ru...@yahoo.com wrote: | On Wednesday, June 5, 2013 3:03:29 PM UTC-6, Chris Angelico wrote: | > On Thu, Jun 6, 2013 at 6:56 AM, wrote: | > > On Wednesday, June 5, 2013 1:54:45 PM UTC-6, Νικόλαος Κούρας wrote: | > >>... | > >> print( cookie, "Content-type: text/html; charset=u

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 8:36 AM, wrote: >> And it's really easy to try things out interactively to see what >> they'll do... > > Sure, once one makes the connection between "Server Error" and missing "\n" > which is where Νικόλαος was stuck I'm guessing. I know that's a bit of a jump. That's why,

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread rurpy
On 06/05/2013 04:21 PM, Chris Angelico wrote: > On Thu, Jun 6, 2013 at 7:18 AM, wrote: >> On Wednesday, June 5, 2013 3:03:29 PM UTC-6, Chris Angelico wrote: ..[...] >> Ah, quite right. Something like >> >> print( cookie, "\nContent-type: text/html; charset=utf-8\n\n", message ) >> >> then. >

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 7:18 AM, wrote: > On Wednesday, June 5, 2013 3:03:29 PM UTC-6, Chris Angelico wrote: >> On Thu, Jun 6, 2013 at 6:56 AM, wrote: >> > On Wednesday, June 5, 2013 1:54:45 PM UTC-6, Νικόλαος Κούρας wrote: >> >>... >> >> print( cookie, "Content-type: text/html; charset=utf-8\n"

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread rurpy
On Wednesday, June 5, 2013 3:03:29 PM UTC-6, Chris Angelico wrote: > On Thu, Jun 6, 2013 at 6:56 AM, wrote: > > On Wednesday, June 5, 2013 1:54:45 PM UTC-6, Νικόλαος Κούρας wrote: > >>... > >> print( cookie, "Content-type: text/html; charset=utf-8\n", message ) > >>... > > print( cookie, "Cont

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 6:56 AM, wrote: > On Wednesday, June 5, 2013 1:54:45 PM UTC-6, Νικόλαος Κούρας wrote: >>... >> print( cookie, "Content-type: text/html; charset=utf-8\n", message ) >>... > > If you look in the Apache error log file, you will see something like, > > [Wed Jun 05 16:39:14 20

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread rurpy
On Wednesday, June 5, 2013 1:54:45 PM UTC-6, Νικόλαος Κούρας wrote: >... > print( cookie, "Content-type: text/html; charset=utf-8\n", message ) >... If you look in the Apache error log file, you will see something like, [Wed Jun 05 16:39:14 2013] [error] [client 192.168.0.1] malformed header fr

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread John Gordon
In <400ea041-adcf-4640-8872-f81808f7d...@googlegroups.com> =?ISO-8859-7?B?zenq/Ovh7/Igyu/98eHy?= writes: > 'python files.py' interprets without an error. > Problem is that when via browser - http://superhost.gr/cgi-bin/koukos.py > i receive the following: Why should 'files.py' have any relation

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 5:54 AM, Νικόλαος Κούρας wrote: > print( cookie, "Content-type: text/html; charset=utf-8\n", message ) > Do you know what this does? Try it at the console. See what it outputs. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread Νικόλαος Κούρας
Since the other thread gone into the wild, i choosed not to participate any longer and i state the question in this new thread. 'python files.py' interprets without an error. Problem is that when via browser - http://superhost.gr/cgi-bin/koukos.py i receive the following: ---

Re: Creating a simple CGI Script

2012-08-02 Thread Smaran Harihar
ran Harihar a écrit : > > Hi, > > I am trying to create a simple CGI Script and following this > tutorials<http://pointlessprogramming.wordpress.com/2011/02/13/python-cgi-tutorial-1/>but > unfortunately my output is only printing the cgi file as it is on the > browse

Re: Creating a simple CGI Script

2012-08-02 Thread Xavier Combelle
In server.py you made a mistake in the declaration of the cgi directory it should be handler.cgi_directories = ["/"] Le 02/08/2012 20:20, Smaran Harihar a écrit : Hi, I am trying to create a simple CGI Script and following this tutorials <http://pointlessprogramming.wordpress.c

Creating a simple CGI Script

2012-08-02 Thread Smaran Harihar
Hi, I am trying to create a simple CGI Script and following this tutorials<http://pointlessprogramming.wordpress.com/2011/02/13/python-cgi-tutorial-1/>but unfortunately my output is only printing the cgi file as it is on the browser. I have already provided the py scripts with the exec

Re: cgi script

2009-08-02 Thread Piet van Oostrum
request. Either the server is overloaded or there was an error in >g> a CGI script. >g> If you think this is a server error, please contact the webmaster. " >g> i am using apache on xampp. plz help Putting the following in your script might help as it will show the

Re: cgi script

2009-08-02 Thread Carl Banks
rloaded or there was an error in > a CGI script. Your script has a syntax error. (You forgot a colon or something like that.) If you can, try to run the file directly from a Python interpreter to see where the error is. Carl Banks -- http://mail.python.org/mailman/listinfo/python-list

cgi script

2009-08-01 Thread golu
Hi, i started learning cgi few days ago in python and everything went fine until i started getting the follwing error " The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script. If you think this

Re: Determining from which web page a cgi script is invoked?

2009-03-11 Thread davidgould
On Mar 10, 7:15 pm, cm wrote: > davidgo...@davidgould.com escribió: > > > Given a webpage test.html that has a form with a cgi script, how can > > you determine inside the cgi script the name of the webpage that > > invoked the script? > > > I have many different

Re: Determining from which web page a cgi script is invoked?

2009-03-11 Thread davidgould
On Mar 10, 7:15 pm, cm wrote: > davidgo...@davidgould.com escribió: > > > Given a webpage test.html that has a form with a cgi script, how can > > you determine inside the cgi script the name of the webpage that > > invoked the script? > > > I have many different

Re: Determining from which web page a cgi script is invoked?

2009-03-10 Thread cm
davidgo...@davidgould.com escribió: Given a webpage test.html that has a form with a cgi script, how can you determine inside the cgi script the name of the webpage that invoked the script? I have many different html pages that use a common cgi script for form processing and want to determine

Re: Determining from which web page a cgi script is invoked?

2009-03-10 Thread Tim Chase
davidgo...@davidgould.com wrote: Given a webpage test.html that has a form with a cgi script, how can you determine inside the cgi script the name of the webpage that invoked the script? I have many different html pages that use a common cgi script for form processing and want to determine the

Determining from which web page a cgi script is invoked?

2009-03-10 Thread davidgould
Given a webpage test.html that has a form with a cgi script, how can you determine inside the cgi script the name of the webpage that invoked the script? I have many different html pages that use a common cgi script for form processing and want to determine the name of the webpage. Thanks

Re: problem adding custom module in cgi script

2008-12-14 Thread bobicanprogram
On Dec 11, 8:03 pm, bobicanprogram wrote: > Problem: > > Apache server serving an HTML file to a Firefox Browser containing a > form and > a CGI python CGI script. HTML works fine, meat of the CGI script works > fine > except that when a home grown and ordinarily functional m

problem adding custom module in cgi script

2008-12-11 Thread bobicanprogram
Problem: Apache server serving an HTML file to a Firefox Browser containing a form and a CGI python CGI script. HTML works fine, meat of the CGI script works fine except that when a home grown and ordinarily functional module that is to be imported is added, the interpreter cannot find it

Re: argument to python cgi script

2008-04-10 Thread Gabriel Genellina
En Wed, 09 Apr 2008 11:14:33 -0300, syed mehdi <[EMAIL PROTECTED]> escribió: > Hi Guys, > If someone can help me in telling how can i pass arguments to python cgi > script then that will be good. > like if i want to pass "some argument" to my remote python script,

argument to python cgi script

2008-04-09 Thread syed mehdi
Hi Guys, If someone can help me in telling how can i pass arguments to python cgi script then that will be good. like if i want to pass "some argument" to my remote python script, by calling something like: http://localhost/cgi-bin/test.py?some\ argument. What is the correct way

Re: Get cgi script to begin execution of another script...

2008-03-13 Thread Sion Arrowsmith
sophie_newbie <[EMAIL PROTECTED]> wrote: >Basically I've a CGI script, that when executed by the user, I want to >call another script that does a very long running task (10 hours +) >and print a message on the screen saying that the user will be emailed >on completion of

Get cgi script to begin execution of another script...

2008-03-12 Thread sophie_newbie
I've posted something similar to this already, but now I'm more sure of what I'm asking. Basically I've a CGI script, that when executed by the user, I want to call another script that does a very long running task (10 hours +) and print a message on the screen saying t

Re: Python CGI script and CSS style sheet

2008-01-23 Thread epsilon
Tim, Thanks for the information and I'll work with you suggestions. Also, I will let you know what I find. Thanks again, Christopher Tim Chase wrote: > > I'm working with a Python CGI script that I am trying to use with an > > external CSS (Cascading Style Sheet) and it

Re: Python CGI script and CSS style sheet

2008-01-23 Thread Tim Chase
> I'm working with a Python CGI script that I am trying to use with an > external CSS (Cascading Style Sheet) and it is not reading it from the > web server. The script runs fine minus the CSS formatting. Does > anyone know if this will work within a Python CGI? It seems that

Python CGI script and CSS style sheet

2008-01-23 Thread epsilon
All: I'm working with a Python CGI script that I am trying to use with an external CSS (Cascading Style Sheet) and it is not reading it from the web server. The script runs fine minus the CSS formatting. Does anyone know if this will work within a Python CGI? It seems that line 18 is not

Re: how to figure out if python was used as a cgi script

2007-11-15 Thread Bjoern Schliessmann
ce wrote: > is there a way to figure out which scripting language was used in > a cgi. I used to watch extensions (i.e. py, pl, asp or php) I'd say that ASP and PHP are rather rarely used for CGI scripts. Also, extensions are essentially meaningless. > nowadays i hardly see any extensions and re

Re: how to figure out if python was used as a cgi script

2007-11-15 Thread Laszlo Nagy
ce wrote: > hi, > > is there a way to figure out which scripting language was used in a > cgi. I used to watch extensions (i.e. py, pl, asp or php) nowadays i > hardly see any extensions and really it is hard to find out anything > from the generated HTML or even the HTML being sent out through the

Re: how to figure out if python was used as a cgi script

2007-11-15 Thread Diez B. Roggisch
ce wrote: > hi, > > is there a way to figure out which scripting language was used in a > cgi. I used to watch extensions (i.e. py, pl, asp or php) nowadays i > hardly see any extensions and really it is hard to find out anything > from the generated HTML or even the HTML being sent out through t

how to figure out if python was used as a cgi script

2007-11-15 Thread ce
hi, is there a way to figure out which scripting language was used in a cgi. I used to watch extensions (i.e. py, pl, asp or php) nowadays i hardly see any extensions and really it is hard to find out anything from the generated HTML or even the HTML being sent out through the FORM tag .. is there

Re: Error when python script run as cgi script

2007-10-22 Thread sophie_newbie
gt; as root runs fine. But if I run it through the web-browser as a cgi > > script gives the following error "Error in X11: unable to start device > > PNG". > > > Now I should say that this python script is calling fucntions in R (a > > scripting languange used

Error when python script run as cgi script

2007-10-21 Thread sophie_newbie
Hi, I'm running a python script which if I run from the command line as root runs fine. But if I run it through the web-browser as a cgi script gives the following error "Error in X11: unable to start device PNG". Now I should say that this python script is calling fucntions in

Re: CGI Script using Python

2007-04-21 Thread Fuzzyman
On Apr 21, 10:02 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > "Ralf" <[EMAIL PROTECTED]> wrote: > > >is there anybody who can help me. > >I would like to use a Python Script to download Files from a Server to the > >Client, to update the Client.

Re: CGI Script using Python

2007-04-21 Thread Tim Roberts
"Ralf" <[EMAIL PROTECTED]> wrote: > >is there anybody who can help me. >I would like to use a Python Script to download Files from a Server to the >Client, to update the Client. Remember, though, that a CGI script cannot actually put files anywhere. You can certainly

Re: CGI Script using Python

2007-04-19 Thread Fuzzyman
On Apr 19, 11:34 am, "Ralf" <[EMAIL PROTECTED]> wrote: > Hello, > is there anybody who can help me. > I would like to use a Python Script to download Files from a Server to the > Client, to update the Client. > Downman is an example of a Python CGI which presents files for download. http://www.vo

CGI Script using Python

2007-04-19 Thread Ralf
Hello, is there anybody who can help me. I would like to use a Python Script to download Files from a Server to the Client, to update the Client. Thanx Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: run a script and supply commands from a python cgi script

2006-12-14 Thread Larry Bates
umentation that comes with the script you wish to run > > The thing is like this. I need to set up a module on my server, but i > cant access the server with a comand line. So I want to run setup.py > script (I nead to run setup.py to setup up the module) from a python > cgi script

run a script and supply commands from a python cgi script

2006-12-14 Thread moishyyehuda
run setup.py script (I nead to run setup.py to setup up the module) from a python cgi script, and supply commands from the script. So if any one can help me with this I would appreciate it. Moishy -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI script running not completely in HTML

2006-08-17 Thread Tim Chase
> In which case you probably need to tweak the server timeout > setting. Nothing you can do from Python (except possibly make > your CGI run faster). Or have Python send a better SQL statement that would run faster...a little SQL mojo goes a long way. The OP failed (as far as my thread-dabbling

Re: CGI script running not completely in HTML

2006-08-17 Thread Steve Holden
Yong Wang wrote: > Hi Steve: >The propblem I run into is about one minute. The CGI script is not > completed to run and aborted. > If I run the python script in backend solaris machine, the script needs about > one minute for database > access. > Thanks, > >

Re: CGI script running not completely in HTML

2006-08-17 Thread Steve Holden
Yong Wang wrote: > Hi, All: > I have written a python CGI script to run in html web page. When I access > to > the html page, it only runs part of the script, then abort because the late > part of > the script is involved in database access, it is slow. I wonder whether th

Re: CGI script running not completely in HTML

2006-08-17 Thread Tim
Yong Wang wrote: > Hi, All: > I have written a python CGI script to run in html web page. When I access > to > the html page, it only runs part of the script, then abort because the late > part of > the script is involved in database access, it is slow. I wonder whether th

  1   2   >