Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #40529 > unrolled thread

Inserting-embedding some html data at the end of a .py file

Started byΝίκος Γκρ33κ <nikos.gr33k@gmail.com>
First post2013-03-05 06:35 -0800
Last post2013-03-05 15:39 -0800
Articles 16 on this page of 56 — 9 participants

Back to article view | Back to comp.lang.python


Contents

  Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 06:35 -0800
    Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 09:11 -0800
      Re: Inserting-embedding some html data at the end of a .py file Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-03-05 17:19 +0000
      Re: Inserting-embedding some html data at the end of a .py file Joel Goldstick <joel.goldstick@gmail.com> - 2013-03-05 12:25 -0500
    Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 09:39 -0800
      Re: Inserting-embedding some html data at the end of a .py file Joel Goldstick <joel.goldstick@gmail.com> - 2013-03-05 12:45 -0500
        Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 09:49 -0800
          Re: Inserting-embedding some html data at the end of a .py file Dave Angel <davea@davea.name> - 2013-03-05 13:18 -0500
            Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 10:53 -0800
              Re: Inserting-embedding some html data at the end of a .py file Joel Goldstick <joel.goldstick@gmail.com> - 2013-03-05 14:33 -0500
              Re: Inserting-embedding some html data at the end of a .py file Dave Angel <davea@davea.name> - 2013-03-05 14:48 -0500
            Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 10:53 -0800
        Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 09:49 -0800
      Re: Inserting-embedding some html data at the end of a .py file Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-03-05 17:53 +0000
      Re: Inserting-embedding some html data at the end of a .py file Roland Koebler <r.koebler@yahoo.de> - 2013-03-06 10:00 +0100
    Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 12:04 -0800
      Re: Inserting-embedding some html data at the end of a .py file Dave Angel <d@davea.name> - 2013-03-05 16:02 -0500
        Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 14:49 -0800
        Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 14:49 -0800
      Re: Inserting-embedding some html data at the end of a .py file "Michael Ross" <gmx@ross.cx> - 2013-03-05 22:29 +0100
    Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 14:47 -0800
      Re: Inserting-embedding some html data at the end of a .py file "Michael Ross" <gmx@ross.cx> - 2013-03-06 00:19 +0100
        Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 15:39 -0800
          Re: Inserting-embedding some html data at the end of a .py file "Michael Ross" <gmx@ross.cx> - 2013-03-06 01:06 +0100
            Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 22:12 -0800
            Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 22:12 -0800
            Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 23:48 -0800
            Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 23:48 -0800
            Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-06 15:18 -0800
              Re: Inserting-embedding some html data at the end of a .py file "Michael Ross" <gmx@ross.cx> - 2013-03-07 01:25 +0100
                Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-06 22:35 -0800
                  Re: Inserting-embedding some html data at the end of a .py file Roland Koebler <r.koebler@yahoo.de> - 2013-03-07 09:58 +0100
                    Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-07 01:05 -0800
                      Re: Inserting-embedding some html data at the end of a .py file Lele Gaifax <lele@metapensiero.it> - 2013-03-07 10:22 +0100
                        Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-07 01:28 -0800
                          Re: Inserting-embedding some html data at the end of a .py file Lele Gaifax <lele@metapensiero.it> - 2013-03-07 10:50 +0100
                            Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-07 01:55 -0800
                            Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-07 01:55 -0800
                          Re: Inserting-embedding some html data at the end of a .py file Chris Angelico <rosuav@gmail.com> - 2013-03-07 21:19 +1100
                            Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-07 02:34 -0800
                            Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-07 02:34 -0800
                              Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-07 03:51 -0800
                              Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-07 03:51 -0800
                        Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-07 01:28 -0800
                        Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-07 02:09 -0800
                          Re: Inserting-embedding some html data at the end of a .py file Joel Goldstick <joel.goldstick@gmail.com> - 2013-03-07 05:28 -0500
                            Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-07 04:06 -0800
                              Re: Inserting-embedding some html data at the end of a .py file Chris Angelico <rosuav@gmail.com> - 2013-03-07 23:17 +1100
                            Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-07 04:06 -0800
                        Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-07 02:09 -0800
                    Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-07 01:05 -0800
                Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-06 22:35 -0800
                Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-06 22:42 -0800
                Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-06 22:42 -0800
            Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-06 15:18 -0800
        Re: Inserting-embedding some html data at the end of a .py file Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 15:39 -0800

Page 3 of 3 — ← Prev page 1 2 [3]


#40745

FromΝίκος Γκρ33κ <nikos.gr33k@gmail.com>
Date2013-03-07 02:34 -0800
Message-ID<mailman.3006.1362652468.2939.python-list@python.org>
In reply to#40742
Τη Πέμπτη, 7 Μαρτίου 2013 12:19:05 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε:
> On Thu, Mar 7, 2013 at 8:50 PM, Lele Gaifax <lele@metapensiero.it> wrote:
> 
> > Νίκος Γκρ33κ <nikos.gr33k@gmail.com> writes:
> 
> >
> 
> >> Τη Πέμπτη, 7 Μαρτίου 2013 11:22:09 π.μ. UTC+2, ο χρήστης Lele Gaifax έγραψε:
> 
> >>> http://docs.python.org/release/3.0.1/whatsnew/3.0.html#changed-syntax
> 
> >>>
> 
> >>> 4th (bullet) point.
> 
> >>
> 
> >> please give me the exact link to read, i cant seem to find it although
> 
> >> you send 4th bullet i do not see it....
> 
> >
> 
> > Oh come on Νίκος, the above *is* the *exact* link to read, I even
> 
> > pointed at the right subparagraph: it contains both a link to the
> 
> > reference manual for the "except" keyword, and a link to the PEP that
> 
> > talks about the change.
> 
> 
> 
> I think it's time to take him up on his offer to call him an idiot :)
> 
> 
> 
> Nikos, try 'as'.
> 
> 
> 
> ChrisA

Thank you all the trick was to replace the comma with the 'as'

script is almost ready for Python v3.2.3 now!

ima just receivign this error:

--> -->
Traceback (most recent call last):
  File "/opt/python3/lib/python3.2/site-packages/MySQL_python-1.2.3-py3.2-linux-x86_64.egg/MySQLdb/cursors.py", line 171, in execute
    r = self._query(query)
  File "/opt/python3/lib/python3.2/site-packages/MySQL_python-1.2.3-py3.2-linux-x86_64.egg/MySQLdb/cursors.py", line 330, in _query
    rowcount = self._do_query(q)
  File "/opt/python3/lib/python3.2/site-packages/MySQL_python-1.2.3-py3.2-linux-x86_64.egg/MySQLdb/cursors.py", line 294, in _do_query
    db.query(q)
_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%s' at line 1")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "metrites.py", line 212, in <module>
    cur.execute( '''SELECT hits FROM counters WHERE url = %s''', (htmlpage,) )
  File "/opt/python3/lib/python3.2/site-packages/MySQL_python-1.2.3-py3.2-linux-x86_64.egg/MySQLdb/cursors.py", line 184, in execute
    self.errorhandler(self, exc, value)
  File "/opt/python3/lib/python3.2/site-packages/MySQL_python-1.2.3-py3.2-linux-x86_64.egg/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass(errorvalue)
_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%s' at line 1")

Tou cna see it more clearly at my website http://superhost.gr

[toc] | [prev] | [next] | [standalone]


#40750

FromΝίκος Γκρ33κ <nikos.gr33k@gmail.com>
Date2013-03-07 03:51 -0800
Message-ID<c6b755bc-22a7-47c0-842a-9777dd63f9df@googlegroups.com>
In reply to#40745
host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]

Why this line that worked in v2.6 give sme an error in v3.2.3

Traceback (most recent call last):
  File "files.py", line 14, in &lt;module&gt;
    host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
  File "/opt/python3/lib/python3.2/os.py", line 450, in __getitem__
    value = self._data[self.encodekey(key)]
KeyError: b'REMOTE_ADDR'

-->

[toc] | [prev] | [next] | [standalone]


#40752

FromΝίκος Γκρ33κ <nikos.gr33k@gmail.com>
Date2013-03-07 03:51 -0800
Message-ID<mailman.3010.1362657121.2939.python-list@python.org>
In reply to#40745
host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]

Why this line that worked in v2.6 give sme an error in v3.2.3

Traceback (most recent call last):
  File "files.py", line 14, in &lt;module&gt;
    host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
  File "/opt/python3/lib/python3.2/os.py", line 450, in __getitem__
    value = self._data[self.encodekey(key)]
KeyError: b'REMOTE_ADDR'

-->

[toc] | [prev] | [next] | [standalone]


#40731

FromΝίκος Γκρ33κ <nikos.gr33k@gmail.com>
Date2013-03-07 01:28 -0800
Message-ID<mailman.2996.1362648534.2939.python-list@python.org>
In reply to#40725
Τη Πέμπτη, 7 Μαρτίου 2013 11:22:09 π.μ. UTC+2, ο χρήστης Lele Gaifax έγραψε:
> Νίκος Γκρ33κ <nikos.gr33k@gmail.com> writes:
> 
> 
> 
> > I did read about print but i'm interesetd to see and its not mentioned there how
> 
> >
> 
> > 	except MySQLdb.Error, e:
> 
> > 		print ( "Query Error: ", sys.exc_info()[1].excepinfo()[2] )
> 
> >
> 
> > is supposed to be written as in Python v3.x
> 
> 
> 
> Read better:
> 
> http://docs.python.org/release/3.0.1/whatsnew/3.0.html#changed-syntax
> 
> 4th (bullet) point.
> 
> 
> 
> ciao, lele.
> 
> -- 
> 
> nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
> 
> real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
> 
> lele@metapensiero.it  |                 -- Fortunato Depero, 1929.

please give me the exact link to read, i cant seem to find it although you send 4th bullet i do not see it....

[toc] | [prev] | [next] | [standalone]


#40741

FromΝίκος Γκρ33κ <nikos.gr33k@gmail.com>
Date2013-03-07 02:09 -0800
Message-ID<69615062-409b-4315-bf5a-77e57ad549f2@googlegroups.com>
In reply to#40725
This fails also:

except MySQLdb.ProgrammingError, e:

How on earth the exception is suppsoed to be written!!!!

[toc] | [prev] | [next] | [standalone]


#40743

FromJoel Goldstick <joel.goldstick@gmail.com>
Date2013-03-07 05:28 -0500
Message-ID<mailman.3005.1362652101.2939.python-list@python.org>
In reply to#40741

[Multipart message — attachments visible in raw view] — view raw

On Thu, Mar 7, 2013 at 5:09 AM, Νίκος Γκρ33κ <nikos.gr33k@gmail.com> wrote:

> This fails also:
>
> except MySQLdb.ProgrammingError, e:
>
> How on earth the exception is suppsoed to be written!!!!
>

Change from except<http://docs.python.org/release/3.0.1/reference/compound_stmts.html#except>
*exc*, *var* to
except<http://docs.python.org/release/3.0.1/reference/compound_stmts.html#except>
*exc* as<http://docs.python.org/release/3.0.1/reference/compound_stmts.html#as>
*var*. See *PEP 3110* <http://www.python.org/dev/peps/pep-3110>.


So change the comma to the word 'as'

> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Joel Goldstick
http://joelgoldstick.com

[toc] | [prev] | [next] | [standalone]


#40754

FromΝίκος Γκρ33κ <nikos.gr33k@gmail.com>
Date2013-03-07 04:06 -0800
Message-ID<a3a6fffc-f597-4ee1-8a23-59e844b48a53@googlegroups.com>
In reply to#40743
An these kind of errors iam receiving to please:

Original exception was:
Traceback (most recent call last):
  File "pelatologio.py", line 230, in <module>
    ''') % (clients, hits, money)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 102-108: ordinal not in range(128)

in python v2.6.6 this code works and now i'am using:

#!/usr/bin/python3
# -*- coding: utf-8 -*-

[toc] | [prev] | [next] | [standalone]


#40756

FromChris Angelico <rosuav@gmail.com>
Date2013-03-07 23:17 +1100
Message-ID<mailman.3013.1362658659.2939.python-list@python.org>
In reply to#40754
On Thu, Mar 7, 2013 at 11:06 PM, Νίκος Γκρ33κ <nikos.gr33k@gmail.com> wrote:
> An these kind of errors iam receiving to please:

Part of being a computer programmer is learning to solve problems.
Dumping piles of problems onto a list like this isn't the best way to
do this. Either pay someone to do the work (there are plenty of web
sites that will help you find freelance programmers), or learn to do
it yourself. Coming to a list like this should be done respectfully -
knowing that you're asking people to devote dev hours for no return -
and preferably in accordance with:

http://www.catb.org/esr/faqs/smart-questions.html

ChrisA

[toc] | [prev] | [next] | [standalone]


#40755

FromΝίκος Γκρ33κ <nikos.gr33k@gmail.com>
Date2013-03-07 04:06 -0800
Message-ID<mailman.3012.1362658023.2939.python-list@python.org>
In reply to#40743
An these kind of errors iam receiving to please:

Original exception was:
Traceback (most recent call last):
  File "pelatologio.py", line 230, in <module>
    ''') % (clients, hits, money)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 102-108: ordinal not in range(128)

in python v2.6.6 this code works and now i'am using:

#!/usr/bin/python3
# -*- coding: utf-8 -*-

[toc] | [prev] | [next] | [standalone]


#40746

FromΝίκος Γκρ33κ <nikos.gr33k@gmail.com>
Date2013-03-07 02:09 -0800
Message-ID<mailman.3007.1362653697.2939.python-list@python.org>
In reply to#40725
This fails also:

except MySQLdb.ProgrammingError, e:

How on earth the exception is suppsoed to be written!!!!

[toc] | [prev] | [next] | [standalone]


#40722

FromΝίκος Γκρ33κ <nikos.gr33k@gmail.com>
Date2013-03-07 01:05 -0800
Message-ID<mailman.2990.1362647155.2939.python-list@python.org>
In reply to#40720
Τη Πέμπτη, 7 Μαρτίου 2013 10:58:13 π.μ. UTC+2, ο χρήστης Roland Koebler έγραψε:
> Hi,
> 
> 
> 
> > but now iam receiving this error concering except:
> 
> > 
> 
> > nikos@superhost.gr [~/www/cgi-bin]# /usr/bin/python3 metrites.py 
> 
> >   File "metrites.py", line 88
> 
> >     except MySQLdb.Error, e:
> 
> >                         ^
> 
> > SyntaxError: invalid syntax
> 
> > nikos@superhost.gr [~/www/cgi-bin]# 
> 
> > 
> 
> > which used to work ok in v2.6.6
> 
> > 
> 
> > can you help?
> 
> Python 3 introduced some Python 2-incompatible changes.
> 
> So, please read: http://docs.python.org/release/3.0.1/whatsnew/3.0.html
> 
> 
> 
> Roland

I did read about print but i'm interesetd to see and its not mentioned there how

	except MySQLdb.Error, e:
		print ( "Query Error: ", sys.exc_info()[1].excepinfo()[2] )

is supposed to be written as in Python v3.x

[toc] | [prev] | [next] | [standalone]


#40707

FromΝίκος Γκρ33κ <nikos.gr33k@gmail.com>
Date2013-03-06 22:35 -0800
Message-ID<mailman.2978.1362638120.2939.python-list@python.org>
In reply to#40677
Τη Πέμπτη, 7 Μαρτίου 2013 2:25:09 π.μ. UTC+2, ο χρήστης Michael Ross έγραψε:

> Either run /usr/bin/python3 /cgi-bin/metrites.py on the shell 
> or better look in your webserver error log.

> Guess:
> In Python 3 "print" is a function. 
> So
> 	print "something"
> will not work. You need to
> 
> 	print("something")

Yes Michael i have already prinr with parenthesis except form the triple quoting:	


	print ''' <center><h2><font color=lime> LOG </font> όλων των <font color=red> HTML </font> σελίδων</h2><br>
		  <table border=5 cellpadding=5 bgcolor=black>
		  <th><font color=orange size=5> Σελίδα </th>  <th><font color=orange size=5> Επισκέψεις </th>
	'''

have turned to:


print(''' <center><h2><font color=lime> LOG </font> όλων των <font color=red> HTML </font> σελίδων</h2><br>
		  <table border=5 cellpadding=5 bgcolor=black>
		  <th><font color=orange size=5> Σελίδα </th>  <th><font color=orange size=5> Επισκέψεις </th>
	''')


but now iam receiving this error concering except:

nikos@superhost.gr [~/www/cgi-bin]# /usr/bin/python3 metrites.py 
  File "metrites.py", line 88
    except MySQLdb.Error, e:
                        ^
SyntaxError: invalid syntax
nikos@superhost.gr [~/www/cgi-bin]# 

which used to work ok in v2.6.6

can you help?

[toc] | [prev] | [next] | [standalone]


#40708

FromΝίκος Γκρ33κ <nikos.gr33k@gmail.com>
Date2013-03-06 22:42 -0800
Message-ID<3b7b7279-f149-4474-9ae0-3c9a73600fe5@googlegroups.com>
In reply to#40677
The whole try stement is as follows to have the compete idea:

	try:
		cur.execute( '''SELECT url, hits FROM counters ORDER BY hits DESC''' )

		data = cur.fetchall()
		for row in data:
			(url, hits) = row
			
			print( "<tr><td><center><a href='http://superhost.gr/?show=log&htmlpage=%s'><font color=tomato size=5> %s </a></td>" ) % (url, url)
			print( "<td><center><font color=cyan size=5> %s </a></td></tr>" ) % (hits)
	except MySQLdb.Error, e:
		print( "Query Error: ", sys.exc_info()[1].excepinfo()[2] )

[toc] | [prev] | [next] | [standalone]


#40709

FromΝίκος Γκρ33κ <nikos.gr33k@gmail.com>
Date2013-03-06 22:42 -0800
Message-ID<mailman.2979.1362638528.2939.python-list@python.org>
In reply to#40677
The whole try stement is as follows to have the compete idea:

	try:
		cur.execute( '''SELECT url, hits FROM counters ORDER BY hits DESC''' )

		data = cur.fetchall()
		for row in data:
			(url, hits) = row
			
			print( "<tr><td><center><a href='http://superhost.gr/?show=log&htmlpage=%s'><font color=tomato size=5> %s </a></td>" ) % (url, url)
			print( "<td><center><font color=cyan size=5> %s </a></td></tr>" ) % (hits)
	except MySQLdb.Error, e:
		print( "Query Error: ", sys.exc_info()[1].excepinfo()[2] )

[toc] | [prev] | [next] | [standalone]


#40667

FromΝίκος Γκρ33κ <nikos.gr33k@gmail.com>
Date2013-03-06 15:18 -0800
Message-ID<mailman.2962.1362611928.2939.python-list@python.org>
In reply to#40585
Τη Τετάρτη, 6 Μαρτίου 2013 2:06:33 π.μ. UTC+2, ο χρήστης Michael Ross έγραψε:

> check_output is available as of Python 2.7
> I guess you are still on version 2.6 ?


I can access each of these from my jailed shell user account without issue, and especially i try /usr/bin/python3

nikos@superhost.gr [~]# /usr/bin/python -V
Python 2.6.6

nikos@superhost.gr [~]# /opt/python3/bin/python3 -V
Python 3.2.3

nikos@superhost.gr [~]# /usr/bin/python3 -V
Python 3.2.3 


Problem is that when i change my shebang constructor to #!/sur/bin/python3 my '/cgi-bin/metrites.py' python cgi scripts produces an internal server error while with #!/sur/bin/python the script works.

Any ideas as to why? I can post ocde if you want to.

[toc] | [prev] | [next] | [standalone]


#40582

FromΝίκος Γκρ33κ <nikos.gr33k@gmail.com>
Date2013-03-05 15:39 -0800
Message-ID<mailman.2915.1362526780.2939.python-list@python.org>
In reply to#40578
htmldata = subprocess.check_output( '/home/nikos/public_html/cgi-bin/' + htmlpage )

htmldata = subprocess.check_output( ['/usr/bin/python', '/home/nikos/public_html/cgi-bin/' + htmlpage] )

Both of the above statemnts fail i'am afraid with the same error message.

[toc] | [prev] | [standalone]


Page 3 of 3 — ← Prev page 1 2 [3]

Back to top | Article view | comp.lang.python


csiph-web