Re: CGI python 3 write RAW BINARY

2010-05-21 Thread sam
On May 7, 7:33 am, Dodo wrote: > Le 01/05/2010 12:52, Dodo a écrit : > > > > > > > Le 30/04/2010 17:52, Antoine Pitrou a écrit : > >> Le Thu, 29 Apr 2010 23:37:32 +0200, Dodo a écrit : > >>> I don't get a thing. > >>> Now with the fix : > >>> All browsers shows a different thing, but not the i

Re: CGI python 3 write RAW BINARY

2010-05-07 Thread Dodo
Le 01/05/2010 12:52, Dodo a écrit : Le 30/04/2010 17:52, Antoine Pitrou a écrit : Le Thu, 29 Apr 2010 23:37:32 +0200, Dodo a écrit : I don't get a thing. Now with the fix : All browsers shows a different thing, but not the image! http://ddclermont.homeip.net/misc/python/ If I save it to co

Re: CGI python 3 write RAW BINARY

2010-05-04 Thread Gabriel Genellina
En Sat, 01 May 2010 07:52:01 -0300, Dodo escribió: Le 30/04/2010 17:52, Antoine Pitrou a écrit : Le Thu, 29 Apr 2010 23:37:32 +0200, Dodo a écrit : I don't get a thing. Now with the fix : All browsers shows a different thing, but not the image! http://ddclermont.homeip.net/misc/python/

Re: CGI python 3 write RAW BINARY

2010-05-01 Thread Dodo
Le 30/04/2010 17:52, Antoine Pitrou a écrit : Le Thu, 29 Apr 2010 23:37:32 +0200, Dodo a écrit : I don't get a thing. Now with the fix : All browsers shows a different thing, but not the image! http://ddclermont.homeip.net/misc/python/ If I save it to computer : * Windows image viewer won't

Re: CGI python 3 write RAW BINARY

2010-04-30 Thread Antoine Pitrou
Le Thu, 29 Apr 2010 23:37:32 +0200, Dodo a écrit : > I don't get a thing. > Now with the fix : > All browsers shows a different thing, but not the image! > http://ddclermont.homeip.net/misc/python/ > > If I save it to computer : > * Windows image viewer won't read it > * Irfanview can read it

Re: CGI python 3 write RAW BINARY

2010-04-29 Thread Dodo
Le 29/04/2010 18:33, Dodo a écrit : Le 29/04/2010 17:07, Antoine Pitrou a écrit : Le Thu, 29 Apr 2010 12:53:53 +0200, Dodo a écrit : @Antoine : It not sys.stdout.buffer.write but sys.stdout.write() instead. But it still doesn't work, now I have empty content Let me insist: please use sys.std

Re: CGI python 3 write RAW BINARY

2010-04-29 Thread Dodo
Le 29/04/2010 22:21, Antoine Pitrou a écrit : Le Thu, 29 Apr 2010 18:33:08 +0200, Dodo a écrit : Oh, I tested on my windows machine avec sys.stdout.buffer.write() didn't work. I just tested on my linux server, and it works So, let's modify the script sys.stdout.buffer.write

Re: CGI python 3 write RAW BINARY

2010-04-29 Thread Antoine Pitrou
Le Thu, 29 Apr 2010 18:33:08 +0200, Dodo a écrit : > Oh, I tested on my windows machine avec sys.stdout.buffer.write() didn't > work. > I just tested on my linux server, and it works > > So, let's modify the script > > sys.stdout.buffer.write( f.read() ) > sys.stdo

Re: CGI python 3 write RAW BINARY

2010-04-29 Thread Dodo
Le 29/04/2010 17:07, Antoine Pitrou a écrit : Le Thu, 29 Apr 2010 12:53:53 +0200, Dodo a écrit : @Antoine : It not sys.stdout.buffer.write but sys.stdout.write() instead. But it still doesn't work, now I have empty content Let me insist: please use sys.stdout.buffer.write(). You'll also have

Re: CGI python 3 write RAW BINARY

2010-04-29 Thread Antoine Pitrou
Le Thu, 29 Apr 2010 12:53:53 +0200, Dodo a écrit : > > @Antoine : It not sys.stdout.buffer.write but sys.stdout.write() > instead. But it still doesn't work, now I have empty content Let me insist: please use sys.stdout.buffer.write(). You'll also have to call sys.stdout.flush() before doing so.

Re: CGI python 3 write RAW BINARY

2010-04-29 Thread Dodo
Le 29/04/2010 01:45, Antoine Pitrou a écrit : Le Wed, 28 Apr 2010 23:54:07 +0200, Dodo a écrit : Help! this is driving me crazy lol I want to print raw binary data to display an image file BUT python3 outputs b'' instead of so the browser can't read the image!! f = open("/some/path/%s"

Re: CGI python 3 write RAW BINARY

2010-04-28 Thread Antoine Pitrou
Le Wed, 28 Apr 2010 23:54:07 +0200, Dodo a écrit : > Help! this is driving me crazy lol > I want to print raw binary data to display an image file BUT > python3 outputs b'' instead of so the > browser can't read the image!! > > f = open("/some/path/%s" % x, 'rb') > print(f.read()) print

Re: CGI python 3 write RAW BINARY

2010-04-28 Thread Gary Herron
Dodo wrote: Help! this is driving me crazy lol I want to print raw binary data to display an image file BUT python3 outputs b'' instead of so the browser can't read the image!! f = open("/some/path/%s" % x, 'rb') print(f.read()) any idea? Dorian Huh??? In what universe does print

Re: CGI Python problem

2008-11-07 Thread Tim O'Toole
> > Well, if Python's not installed, the next step is _getting_ it installed -- > whether having your admin install it globally (I mean, who *doesn't* install > python?! ;-) or you install it locally in your home directory as detailed > at [1] where you download the source and compile from scratch

Re: CGI Python problem

2008-11-06 Thread Tim Chase
Tim O'Toole wrote: Alas that cgi script confirmed python is not installed on the server machine (which I had assumed it was). Did you also try it with the "find" variant in addition to just the "which" version? This would find Python if it wasn't on the $PATH. Looks like game over with th

Re: CGI Python problem

2008-11-06 Thread Tim O'Toole
Alas that cgi script confirmed python is not installed on the server machine (which I had assumed it was). Looks like game over with this avenue of trouble shooting? On Fri, Nov 7, 2008 at 1:03 AM, Tim Chase <[EMAIL PROTECTED]> wrote: >> As for writing some perl, not too sure how to do that, but

Re: CGI Python problem

2008-11-06 Thread Tim Chase
As for writing some perl, not too sure how to do that, but from the information in phpinfo I logged onto the webserver machine and did a "whereis python" - it came back blank! Of course doing a whereis perl gave a non-blank answer. So this seems to be the route cause of my trouble. Indeed! I ma

Re: CGI Python problem

2008-11-06 Thread Tim O'Toole
With regard to phpinfo(), its shows the mod_cgi is loaded, but neither mod_perl or mod_python is loaded (I read on the python.org site that mod_python can interfere with running python through mod_python). As for writing some perl, not too sure how to do that, but from the information in phpinfo I

Re: CGI Python problem

2008-11-06 Thread Tim Chase
Here is the permissions, which I think are definitely right now: drwxrwxrwx 8 4.0K Nov 6 13:34 public_html/ drwxrwxrwx 2 4.0K Nov 6 13:35 cgi-bin/ [inside public_html] -rw-r-xr-x 1 117 Nov 6 11:39 test_pl.cgi* [inside cgi-bin] -rw-r-xr-x 1 168

Re: CGI Python problem

2008-11-06 Thread Tim O'Toole
Thanks for replying Tim, Here is the permissions, which I think are definitely right now: drwxrwxrwx 8 4.0K Nov 6 13:34 public_html/ drwxrwxrwx 2 4.0K Nov 6 13:35 cgi-bin/ [inside public_html] -rw-r-xr-x 1 117 Nov 6 11:39 test_pl.cgi* [inside cgi-bin] -rw-

Re: CGI Python problem

2008-11-06 Thread Tim Chase
I've placed this file in both public_html and as a test in public_html/ cgi-bin directories in my local user account (I dont have root access - its a corparate network). The file definitely has read and execute permission (744) as have the assoicated directories. My guess would be the permission

Re: CGI python use "under a curse"

2007-05-07 Thread Steve Holden
Adrian Smith wrote: > On May 7, 2:30 pm, Steven D'Aprano > <[EMAIL PROTECTED]> wrote: >> On Sun, 06 May 2007 21:30:16 -0700, Adrian Smith wrote: > >> It is NOT the same error. There are NO syntax errors in the script, there >> is a runtime error. The so-called administrator is wrong: you can't use

Re: CGI python use "under a curse"

2007-05-06 Thread Adrian Smith
On May 7, 2:30 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 06 May 2007 21:30:16 -0700, Adrian Smith wrote: > It is NOT the same error. There are NO syntax errors in the script, there > is a runtime error. The so-called administrator is wrong: you can't use > Perl to test just any old

Re: CGI python use "under a curse"

2007-05-06 Thread Steven D'Aprano
On Sun, 06 May 2007 21:30:16 -0700, Adrian Smith wrote: > The support guy looked at it and gave me this: > > Traceback (most recent call last): > File "python1.cgi", line 6, in ? > print form["essay"].value > File "/usr/local/lib/python2.4/cgi.py", line 559, in __getitem__ raise > KeyError, key >

Re: CGI Python FTP

2006-02-09 Thread Rene Pijlman
[EMAIL PROTECTED]: >I know PHP has support for uploading files from the browser to the >server, but does python (not mod_py) have any modules for going about >this? http://www.python.org/doc/2.3.2/lib/node403.html http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/273844 -- René Pijlman --

Re: cgi python

2005-10-13 Thread Fredrik Lundh
Paul Boddie wrote: > Testing Web applications can be hard, but the traceback tells you > everything you need to know here. especially if you make sure to use the cgitb module: http://docs.python.org/lib/module-cgitb.html while developing/debugging. -- http://mail.python.org/mailman/li

Re: cgi python

2005-10-13 Thread Paul Boddie
Python_it wrote: > I going to use the cgi-handler (mod_python): > > http://www.modpython.org/live/mod_python-3.2.2b/doc-html/hand-cgi.html > > If I test a simply py script it works You don't say how you test it, but I imagine that you just point your browser to the location where the program is pu

Re: cgi python

2005-10-13 Thread Christian Hausknecht
Python_it wrote: > I going to use the cgi-handler (mod_python): > > http://www.modpython.org/live/mod_python-3.2.2b/doc-html/hand-cgi.html > > > If I test a simply py script it works > > code: > === > print "Content-type: text/html\n" > print """ > > > TEST > > > """ >