482 |
|
|
483 |
import os |
import os |
484 |
|
|
485 |
|
sample = "test/sample.xml" |
486 |
try: |
try: |
487 |
f = open("test/sample.xml", "r") |
f = open(sample, "r") |
488 |
except IOError: |
except IOError: |
489 |
try: |
try: |
490 |
f = open(os.path.dirname(__file__) + "/test/sample.xml", "r") |
f = open(os.path.dirname(__file__) + "/" + sample, "r") |
491 |
except IOError: |
except IOError: |
492 |
print "Cannot open sample.xml for reading" |
print "Cannot open %s for reading" % sample |
493 |
|
|
494 |
if f is not None: |
if f is not None: |
495 |
sample = f.read(); |
sample = f.read(); |