Hi,
but now iam receiving this error concering except:
ni...@superhost.gr [~/www/cgi-bin]# /usr/bin/python3 metrites.py
File metrites.py, line 88
except MySQLdb.Error, e:
^
SyntaxError: invalid syntax
ni...@superhost.gr [~/www/cgi-bin]#
which used to
Τη Πέμπτη, 7 Μαρτίου 2013 10:58:13 π.μ. UTC+2, ο χρήστης Roland Koebler έγραψε:
Hi,
but now iam receiving this error concering except:
ni...@superhost.gr [~/www/cgi-bin]# /usr/bin/python3 metrites.py
File metrites.py, line 88
except MySQLdb.Error, e:
Νίκος Γκρ33κ nikos.gr...@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:
Τη Πέμπτη, 7 Μαρτίου 2013 11:22:09 π.μ. UTC+2, ο χρήστης Lele Gaifax έγραψε:
Νίκος Γκρ33κ nikos.gr...@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: ,
Τη Πέμπτη, 7 Μαρτίου 2013 11:50:42 π.μ. UTC+2, ο χρήστης Lele Gaifax έγραψε:
Νίκος Γκρ33κ nikos.gr...@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
Νίκος Γκρ33κ nikos.gr...@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
This fails also:
except MySQLdb.ProgrammingError, e:
How on earth the exception is suppsoed to be written
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Mar 7, 2013 at 8:50 PM, Lele Gaifax l...@metapensiero.it wrote:
Νίκος Γκρ33κ nikos.gr...@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
On Thu, Mar 7, 2013 at 5:09 AM, Νίκος Γκρ33κ nikos.gr...@gmail.com wrote:
This fails also:
except MySQLdb.ProgrammingError, e:
How on earth the exception is suppsoed to be written
Change from
excepthttp://docs.python.org/release/3.0.1/reference/compound_stmts.html#except
*exc*, *var*
Τη Πέμπτη, 7 Μαρτίου 2013 12:19:05 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε:
On Thu, Mar 7, 2013 at 8:50 PM, Lele Gaifax l...@metapensiero.it wrote:
Νίκος Γκρ33κ nikos.gr...@gmail.com writes:
Τη Πέμπτη, 7 Μαρτίου 2013 11:22:09 π.μ. UTC+2, ο χρήστης Lele Gaifax
έγραψε:
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;modulegt;
host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
File
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
On Thu, Mar 7, 2013 at 11:06 PM, Νίκος Γκρ33κ nikos.gr...@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
Hi,
On Tue, Mar 05, 2013 at 09:39:19AM -0800, Νίκος Γκρ33κ wrote:
But i did, I just tried this:
# open html template
if htmlpage.endswith('.html'):
f = open( /home/nikos/public_html/ + htmlpage )
htmldata = f.read()
counter =
Τη Τετάρτη, 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
On Thu, 07 Mar 2013 00:18:44 +0100, Νίκος Γκρ33κ nikos.gr...@gmail.com
wrote:
Τη Τετάρτη, 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
Τη Πέμπτη, 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
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
Any ideas on hopw to embed some html data at the end of each python script?
--
http://mail.python.org/mailman/listinfo/python-list
On 05/03/2013 17:11, Νίκος Γκρ33κ wrote:
Any ideas on hopw to embed some html data at the end of each python script?
Write some code.
--
Cheers.
Mark Lawrence
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Mar 5, 2013 at 12:19 PM, Mark Lawrence breamore...@yahoo.co.ukwrote:
On 05/03/2013 17:11, Νίκος Γκρ33κ wrote:
Any ideas on hopw to embed some html data at the end of each python
script?
http://redwing.hutman.net/~mreed/warriorshtm/ferouscranus.htm
Write some code.
--
Cheers.
On Tue, Mar 5, 2013 at 12:39 PM, Νίκος Γκρ33κ nikos.gr...@gmail.com wrote:
But i did, I just tried this:
# open html template
if htmlpage.endswith('.html'):
f = open( /home/nikos/public_html/ + htmlpage )
htmldata = f.read()
What extra triple quote?
There are 2 sets of triple quotes the counter's and the print's !!
in case htmlpage variable is a .py file i must append a print '''html''' in
order for .py code to absorve that code properly no?
--
http://mail.python.org/mailman/listinfo/python-list
On 05/03/2013 17:39, Νίκος Γκρ33κ wrote:
But i did, I just tried this:
# open html template
if htmlpage.endswith('.html'):
f = open( /home/nikos/public_html/ + htmlpage )
htmldata = f.read()
counter = ''' centera
On 03/05/2013 12:49 PM, Νίκος Γκρ33κ wrote:
What extra triple quote?
There are 2 sets of triple quotes the counter's and the print's !!
There are 3 pairs of triple-quotes. But one pair is nested inside the
other, so the interpreter will not handle it the way you apparently
want. If you
Let's focus on just the following snipper please:
f = open( some_python_file )
htmldata = f.read()
counter = ''' print(
centera href=mailto:supp...@superhost.gr;
img src=/data/images/mail.png /a
centertable border=2
On Tue, Mar 5, 2013 at 1:53 PM, Νίκος Γκρ33κ nikos.gr...@gmail.com wrote:
Let's focus on just the following snipper please:
f = open( some_python_file )
htmldata = f.read()
counter = ''' print(
centera href=mailto:supp...@superhost.gr;
img
On 03/05/2013 01:53 PM, Νίκος Γκρ33κ wrote:
Let's focus on just the following snipper please:
Once again, I repeat. Make a fragment that contains enough information
to actually run. Explain in what environment it's running, and what you
hoped would happen. For example, why on earth would
#open html template
if htmlpage.endswith('.html'):
f = open( /home/nikos/public_html/ + htmlpage )
htmldata = f.read()
counter = ''' centera href=mailto:supp...@superhost.gr;
img src=/data/images/mail.png /a
On 03/05/2013 03:04 PM, Νίκος Γκρ33κ wrote:
#open html template
if htmlpage.endswith('.html'):
f = open( /home/nikos/public_html/ + htmlpage )
htmldata = f.read()
counter = ''' centera href=mailto:supp...@superhost.gr; img
On Tue, 05 Mar 2013 21:04:59 +0100, Νίκος Γκρ33κ nikos.gr...@gmail.com
wrote:
#open html template
if htmlpage.endswith('.html'):
f = open( /home/nikos/public_html/ + htmlpage )
htmldata = f.read()
counter = ''' centera
Τη Τρίτη, 5 Μαρτίου 2013 11:02:18 μ.μ. UTC+2, ο χρήστης Dave Angel έγραψε:
In other words, you're just trying to waste our time. Thanks for
telling us.
Honestly, its not in my intentions to waste your time.
I appreciate all the great help you have provided me in all of my questions, i
On Tue, 05 Mar 2013 23:47:18 +0100, Νίκος Γκρ33κ nikos.gr...@gmail.com
wrote:
Thank you very much! This is what i was looking for and here is my code
after receiving your help.
So, with the command you provided to me i can actually run the .py
script ans save its output and then append
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.
--
On Wed, 06 Mar 2013 00:39:31 +0100, Νίκος Γκρ33κ nikos.gr...@gmail.com
wrote:
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
Τη Τετάρτη, 6 Μαρτίου 2013 2:06:33 π.μ. UTC+2, ο χρήστης Michael Ross έγραψε:
On Wed, 06 Mar 2013 00:39:31 +0100, Νίκος Γκρ33κ
wrote:
htmldata = subprocess.check_output( '/home/nikos/public_html/cgi-bin/' +
htmlpage )
htmldata = subprocess.check_output(
Τη Τετάρτη, 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 ?
Indeed!
i just checked it's Python 2.6.6: /usr/bin/python and i have asked the linxu
admins @ hostgator.com to update python.
37 matches
Mail list logo