Skip to content

Any need or way to explicitly release resources from loadPage #975

Answered by JorjMcKie
petertennis asked this question in Q&A
Discussion options

You must be logged in to vote

do I need to close the page in some way here to releae resources??

No, this happens automatically when the name page is re-assigned, so no worries.
Except for the last page of course ... which will be freed by either end of script or you may assign it to None or delete it.

You are aware that your loop has a more elegant variant:

for page in document:
    # process 'page'

# or from back to front:
for page in reversed(document):
    # process 'page'

Slice-like variants also exist.

for page in document.pages(100, 13, -1):
    # ...

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@petertennis
Comment options

@petertennis
Comment options

@JorjMcKie
Comment options

@petertennis
Comment options

@JorjMcKie
Comment options

Answer selected by JorjMcKie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants