Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
Errors with PyPdf
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Dave Angel, post: 4135574"] There's no global variable content, that was local to the function. So it's lost when the function exits. it does return the value, but you give it to print, and don't save it anywhere. data = getPDFContent(r"C:\Components-of-Dot-NET.pdf").encode("ascii", "ignore") outfile = open('x.txt', 'w') outfile.write(data) close(outfile) I used a different name to emphasize that this is *not* the same variable as content inside the function. In this case, it happens to have the same value. And if you used the same name, you could be confused about which is which. DaveA [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
Errors with PyPdf
Top