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

2013-03-07 Thread Chris Angelico
On Thu, Mar 7, 2013 at 11:06 PM, Νίκος Γκρ33κ 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 pl

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

2013-03-07 Thread Νίκος Γκρ33κ
An these kind of errors iam receiving to please: Original exception was: Traceback (most recent call last): File "pelatologio.py", line 230, in ''') % (clients, hits, money) UnicodeEncodeError: 'ascii' codec can't encode characters in position 102-108: ordinal not in range(128) in python

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

2013-03-07 Thread Νίκος Γκρ33κ
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 host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0] File "/opt/python3/lib/python3.2/o

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

2013-03-07 Thread Νίκος Γκρ33κ
Τη Πέμπτη, 7 Μαρτίου 2013 12:19:05 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Thu, Mar 7, 2013 at 8:50 PM, Lele Gaifax wrote: > > > Νίκος Γκρ33κ writes: > > > > > >> Τη Πέμπτη, 7 Μαρτίου 2013 11:22:09 π.μ. UTC+2, ο χρήστης Lele Gaifax > >> έγραψε: > > >>> http://docs.python.org/releas

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

2013-03-07 Thread Joel Goldstick
On Thu, Mar 7, 2013 at 5:09 AM, Νίκος Γκρ33κ wrote: > This fails also: > > except MySQLdb.ProgrammingError, e: > > How on earth the exception is suppsoed to be written > Change from except *exc*, *var* to except

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

2013-03-07 Thread Chris Angelico
On Thu, Mar 7, 2013 at 8:50 PM, Lele Gaifax wrote: > Νίκος Γκρ33κ 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

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

2013-03-07 Thread Νίκος Γκρ33κ
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

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

2013-03-07 Thread Lele Gaifax
Νίκος Γκρ33κ 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

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

2013-03-07 Thread Νίκος Γκρ33κ
Τη Πέμπτη, 7 Μαρτίου 2013 11:50:42 π.μ. UTC+2, ο χρήστης Lele Gaifax έγραψε: > Νίκος Γκρ33κ 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)

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

2013-03-07 Thread Νίκος Γκρ33κ
Τη Πέμπτη, 7 Μαρτίου 2013 11:22:09 π.μ. UTC+2, ο χρήστης Lele Gaifax έγραψε: > Νίκος Γκρ33κ 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

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

2013-03-07 Thread Lele Gaifax
Νίκος Γκρ33κ 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.pytho

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

2013-03-07 Thread Νίκος Γκρ33κ
Τη Πέμπτη, 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

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

2013-03-07 Thread 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: > ^ > SyntaxError: invalid syntax > ni...@superhost.gr [~/www/cgi-bin]# > > which

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

2013-03-06 Thread Νίκος Γκρ33κ
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

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

2013-03-06 Thread Νίκος Γκρ33κ
Τη Πέμπτη, 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 >

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

2013-03-06 Thread Michael Ross
On Thu, 07 Mar 2013 00:18:44 +0100, Νίκος Γκρ33κ 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 user account without

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

2013-03-06 Thread Νίκος Γκρ33κ
Τη Τετάρτη, 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 ni...@superhost.

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

2013-03-06 Thread Roland Koebler
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

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

2013-03-05 Thread Νίκος Γκρ33κ
Τη Τετάρτη, 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 pytho

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

2013-03-05 Thread Νίκος Γκρ33κ
Τη Τετάρτη, 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(

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

2013-03-05 Thread 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( ['/usr/bin/python', '/home/nikos/public_html/cgi-bin/' + htmlpage] ) Both of the above statemnts fail i'am afr

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

2013-03-05 Thread Νίκος Γκρ33κ
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. -- http://mail.python.org/mailm

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

2013-03-05 Thread Michael Ross
On Tue, 05 Mar 2013 23:47:18 +0100, Νίκος Γκρ33κ 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 from there!! Great! Her

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

2013-03-05 Thread Νίκος Γκρ33κ
Τη Τρίτη, 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 r

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

2013-03-05 Thread Michael Ross
On Tue, 05 Mar 2013 21:04:59 +0100, Νίκος Γκρ33κ wrote: #open html template if htmlpage.endswith('.html'): f = open( "/home/nikos/public_html/" + htmlpage ) htmldata = f.read() counter = ''' mailto:supp...@superhost.gr";> src="/data/images/ma

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

2013-03-05 Thread Dave Angel
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 = ''' mailto:supp...@superhost.gr";>

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

2013-03-05 Thread Νίκος Γκρ33κ
#open html template if htmlpage.endswith('.html'): f = open( "/home/nikos/public_html/" + htmlpage ) htmldata = f.read() counter = ''' mailto:supp...@superhost.gr";>

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

2013-03-05 Thread Dave Angel
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 y

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

2013-03-05 Thread Joel Goldstick
On Tue, Mar 5, 2013 at 1:53 PM, Νίκος Γκρ33κ wrote: > Let's focus on just the following snipper please: > > f = open( some_python_file ) > > htmldata = f.read() > counter = ''' print( " > mailto:supp...@superhost.gr";> > >bgcolor=bla

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

2013-03-05 Thread Νίκος Γκρ33κ
Let's focus on just the following snipper please: f = open( some_python_file ) htmldata = f.read() counter = ''' print( " mailto:supp...@superhost.gr";> Αριθμός Επισκεπτών

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

2013-03-05 Thread Dave Angel
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 have

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

2013-03-05 Thread Mark Lawrence
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 = ''' mailto:supp...@sup

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

2013-03-05 Thread Νίκος Γκρ33κ
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

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

2013-03-05 Thread Joel Goldstick
On Tue, Mar 5, 2013 at 12:39 PM, Νίκος Γκρ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 =

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

2013-03-05 Thread Joel Goldstick
On Tue, Mar 5, 2013 at 12:19 PM, Mark Lawrence wrote: > 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. > > Mark

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

2013-03-05 Thread Mark Lawrence
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

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

2013-03-05 Thread Νίκος Γκρ33κ
Any ideas on hopw to embed some html data at the end of each python script? -- http://mail.python.org/mailman/listinfo/python-list