Re: Coming from Perl

2007-09-18 Thread Steve Holden
Amer Neely wrote: > Bryan Olson wrote: >> Amer Neely wrote: >>> I don't have shell access but I can run 'which python' from a Perl >>> script, and I will try the different shebang line you suggested. >> And after trying it, Amer Neely reported: >> >>> I tried `which python` and `whereis python` an

Re: Coming from Perl

2007-09-17 Thread Amer Neely
Bryan Olson wrote: > Amer Neely wrote: >> I don't have shell access but I can run 'which python' from a Perl >> script, and I will try the different shebang line you suggested. > > And after trying it, Amer Neely reported: > >> I tried `which python` and `whereis python` and got 0 back as a >>

Re: Coming from Perl

2007-09-16 Thread Bryan Olson
Amer Neely wrote: > I don't have shell access but I can run 'which python' from a Perl > script, and I will try the different shebang line you suggested. And after trying it, Amer Neely reported: > I tried `which python` and `whereis python` and got 0 back as a result. > So it seems Python is n

Re: Coming from Perl

2007-09-16 Thread Amer Neely
Paddy wrote: > On Sep 13, 1:30 am, Amer Neely <[EMAIL PROTECTED]> wrote: >> I'm a complete newbie with Python, but have several years experience >> with Perl in a web environment. >> >> A question I have, if someone here is familiar with Perl, does Python >> have something like Perl's 'here documen

Re: Coming from Perl

2007-09-15 Thread Amer Neely
Bryan Olson wrote: > Amer Neely wrote: >> This seems to indicate that maybe my host needs to configure Apache to >> run python scripts? But I didn't need to do anything with mine. > > Another possibility: If it works on Windows but not Unix, check > the end-of-line characters. Windows ends each l

Re: Coming from Perl

2007-09-15 Thread Amer Neely
Bryan Olson wrote: > Amer Neely wrote: >> This seems to indicate that maybe my host needs to configure Apache to >> run python scripts? But I didn't need to do anything with mine. > > Another possibility: If it works on Windows but not Unix, check > the end-of-line characters. Windows ends each l

Re: Coming from Perl - SOLVED

2007-09-15 Thread Amer Neely
I V wrote: > On Thu, 13 Sep 2007 23:49:32 -0400, Amer Neely wrote: >> In trying to track down why this script would not run on my host, it has >> to come to light that Python is installed, however the Apache module is >> not. So, short story is - I was flogging a dead horse. > > Which Apache modul

Re: Coming from Perl

2007-09-14 Thread Bryan Olson
Amer Neely wrote: > This seems to indicate that maybe my host needs to configure Apache to > run python scripts? But I didn't need to do anything with mine. Another possibility: If it works on Windows but not Unix, check the end-of-line characters. Windows ends each line with the two character se

Re: Coming from Perl - SOLVED

2007-09-14 Thread I V
On Thu, 13 Sep 2007 23:49:32 -0400, Amer Neely wrote: > In trying to track down why this script would not run on my host, it has > to come to light that Python is installed, however the Apache module is > not. So, short story is - I was flogging a dead horse. Which Apache module? You don't need an

Re: Coming from Perl - SOLVED

2007-09-13 Thread Amer Neely
Amer Neely wrote: > I'm a complete newbie with Python, but have several years experience > with Perl in a web environment. > > A question I have, if someone here is familiar with Perl, does Python > have something like Perl's 'here document'? I've just searched and read > some postings on gener

Re: Coming from Perl

2007-09-13 Thread Paddy
On Sep 13, 1:30 am, Amer Neely <[EMAIL PROTECTED]> wrote: > I'm a complete newbie with Python, but have several years experience > with Perl in a web environment. > > A question I have, if someone here is familiar with Perl, does Python > have something like Perl's 'here document'? I've just search

Re: Coming from Perl

2007-09-13 Thread Amer Neely
Tim Golden wrote: > Amer Neely wrote: >> Richie Hindle wrote: [Amer] #!/usr/bin/python [...] On my home PC [...] [Thu Sep 13 04:16:03 2007] [error] [client 0.0.0.0] (OS 2)The system cannot find the file specified. >>> That's because on your home PC Python is somewhere like

Re: Coming from Perl

2007-09-13 Thread Tim Golden
Amer Neely wrote: > Richie Hindle wrote: >>> [Amer] >>> #!/usr/bin/python >>> [...] On my home PC [...] >>> [Thu Sep 13 04:16:03 2007] [error] [client 0.0.0.0] (OS 2)The system >>> cannot find the file specified. >> That's because on your home PC Python is somewhere like >> C:\Python25\python.exe,

Re: Coming from Perl

2007-09-13 Thread Amer Neely
Amer Neely wrote: > Richie Hindle wrote: >>> [Amer] >>> #!/usr/bin/python >>> [...] On my home PC [...] >>> [Thu Sep 13 04:16:03 2007] [error] [client 0.0.0.0] (OS 2)The system >>> cannot find the file specified. >> >> That's because on your home PC Python is somewhere like >> C:\Python25\python.e

Re: Coming from Perl

2007-09-13 Thread Amer Neely
Richie Hindle wrote: >> [Amer] >> #!/usr/bin/python >> [...] On my home PC [...] >> [Thu Sep 13 04:16:03 2007] [error] [client 0.0.0.0] (OS 2)The system >> cannot find the file specified. > > That's because on your home PC Python is somewhere like > C:\Python25\python.exe, not /usr/bin/python. >

Re: Coming from Perl

2007-09-13 Thread Richie Hindle
> [Amer] > #!/usr/bin/python > [...] On my home PC [...] > [Thu Sep 13 04:16:03 2007] [error] [client 0.0.0.0] (OS 2)The system > cannot find the file specified. That's because on your home PC Python is somewhere like C:\Python25\python.exe, not /usr/bin/python. Are you sure /usr/bin/python is

Re: Coming from Perl

2007-09-13 Thread Amer Neely
Richie Hindle wrote: > [Amer] >> Can you or anyone see anything in the posted code that might be the >> cause? > >> #!/usr/bin/python >> import cgitb; cgitb.enable(display=0, logdir=".") >> import sys >> sys.stderr = sys.stdout >> print "Content-Type: text/html" >> print > > My guess would be th

Re: Coming from Perl

2007-09-13 Thread Richie Hindle
[Amer] > Can you or anyone see anything in the posted code that might be the > cause? > #!/usr/bin/python > import cgitb; cgitb.enable(display=0, logdir=".") > import sys > sys.stderr = sys.stdout > print "Content-Type: text/html" > print My guess would be that you don't have cgitb in your serv

Re: Coming from Perl

2007-09-13 Thread Amer Neely
Ben Finney wrote: > Amer Neely <[EMAIL PROTECTED]> writes: > >> Well, I have checked everything I can but I'm getting '500 Internal >> Server Error'. > > This is the HTTP response code saying that the program that should > have served the response document instead exited with an error. > > To de

Re: Coming from Perl

2007-09-13 Thread Ben Finney
Amer Neely <[EMAIL PROTECTED]> writes: > Well, I have checked everything I can but I'm getting '500 Internal > Server Error'. This is the HTTP response code saying that the program that should have served the response document instead exited with an error. To debug, you should first run the prog

Re: Coming from Perl

2007-09-13 Thread Amer Neely
Amer Neely wrote: > TheFlyingDutchman wrote: >> On Sep 12, 5:30 pm, Amer Neely <[EMAIL PROTECTED]> wrote: >>> I'm a complete newbie with Python, but have several years experience >>> with Perl in a web environment. >>> >>> A question I have, if someone here is familiar with Perl, does Python >>> ha

Re: Coming from Perl

2007-09-13 Thread Amer Neely
TheFlyingDutchman wrote: > On Sep 12, 5:30 pm, Amer Neely <[EMAIL PROTECTED]> wrote: >> I'm a complete newbie with Python, but have several years experience >> with Perl in a web environment. >> >> A question I have, if someone here is familiar with Perl, does Python >> have something like Perl's '

Re: Coming from Perl

2007-09-12 Thread Ben Finney
Amer Neely <[EMAIL PROTECTED]> writes: > print < > > Hello > > > EndHTML The equivalent in Python would be:: print """ Hello """ You can even use Python's standard textwrap module to indent your code properly:: import textwrap def foo(bar):

RE: Coming from Perl

2007-09-12 Thread Ryan Ginstrom
> On Behalf Of Amer Neely > I saw that and I guess that is the closest thing. In Perl I can do .. > > print < > > Hello > > > EndHTML >>> data = dict(title="Python Rocks!", content="I heart Python") >>> template = """ %(title)s %(content)s """ >>> print template % data Pytho

Re: Coming from Perl

2007-09-12 Thread Amer Neely
TheFlyingDutchman wrote: > On Sep 12, 5:30 pm, Amer Neely <[EMAIL PROTECTED]> wrote: >> I'm a complete newbie with Python, but have several years experience >> with Perl in a web environment. >> >> A question I have, if someone here is familiar with Perl, does Python >> have something like Perl's '

Re: Coming from Perl

2007-09-12 Thread TheFlyingDutchman
On Sep 12, 5:30 pm, Amer Neely <[EMAIL PROTECTED]> wrote: > I'm a complete newbie with Python, but have several years experience > with Perl in a web environment. > > A question I have, if someone here is familiar with Perl, does Python > have something like Perl's 'here document'? I've just search

Re: Coming from Perl

2007-09-12 Thread Amer Neely
Ben Finney wrote: > Amer Neely <[EMAIL PROTECTED]> writes: > >> A question I have, if someone here is familiar with Perl, does Python >> have something like Perl's 'here document'? > > I'm not sure exactly what behaviour you want, but Python accepts > literal strings to be triple-quoted (i.e. del

Re: Coming from Perl

2007-09-12 Thread Ben Finney
Amer Neely <[EMAIL PROTECTED]> writes: > A question I have, if someone here is familiar with Perl, does Python > have something like Perl's 'here document'? I'm not sure exactly what behaviour you want, but Python accepts literal strings to be triple-quoted (i.e. delimited by """ pairs or ''' pai