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

Νίκος Γκρ33κ nikos.gr33k at gmail.com
Thu Mar 7 01:35:12 EST 2013


Τη Πέμπτη, 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 at superhost.gr [~/www/cgi-bin]# /usr/bin/python3 metrites.py 
  File "metrites.py", line 88
    except MySQLdb.Error, e:
                        ^
SyntaxError: invalid syntax
nikos at superhost.gr [~/www/cgi-bin]# 

which used to work ok in v2.6.6

can you help?



More information about the Python-list mailing list