> Is there a way to do the same thing in Python? Not without some clever tricks. Either you store data at the beginning of the file or you have another file with the data.
If you really need one file and data at the end, you can roll your own. Something like: def data(): with open(__file__) as fo: for line in fo: if line.startswith('# __data__'): return ''.join(line[2:] for line in fo) def main(): print(data()) if __name__ == '__main__': main() # __data__ # blah # blah # blah -- http://mail.python.org/mailman/listinfo/python-list