An error when i switched from python v2.6.6 => v3.2.3

Νίκος Γκρ33κ nikos.gr33k at gmail.com
Thu Mar 7 09:34:08 EST 2013


Docs doesn't explain that i just take looked at http://docs.python.org/2/library/os.html#os.system

I see that the return value of os.system its an indicator to as if the command inside os.system() returned successfully.

So i guess ill be needing somethign like this:

htmltemp = '/home/nikos/www/data/private/htmltemp'

if htmlpage.endswith('.html'):
	f = open( "/home/nikos/www/" + htmlpage )
	htmldata = f.read()
elif htmlpage.endswith('.py'):
	os.system( 'python metrites.py > %s' ) % htmltemp
	f = open( htmltemp )
	htmldata = f.read()

template = htmldata + counter
==============

which i just tried and now iam receiving this:

<type 'exceptions.TypeError'>: unsupported operand type(s) for %: 'int' and 'str' 

I'am very close to the solution now i cna feel it but please help a bit!



More information about the Python-list mailing list