Using filepath method to identify an .html page

Ferrous Cranus nikos.gr33k at gmail.com
Tue Jan 22 11:07:54 CET 2013


Hello, i decided to switch from embedding string into .html to actually grab the filepath in order to identify it:

# =================================================================================================================
# open current html template and get the page ID number
# ===============================

f = open( page )

# read first line of the file
firstline = f.readline()

# find the ID of the file and store it
pin = re.match( r'<!-- (\d+) -->', firstline ).group(1)
=================================

This is what i used to have.

Now, can you pleas help me write the switch to filepath identifier?
I'am having trouble writing it.



More information about the Python-list mailing list