# PDF Extraction with python wrappers

**URL:** <https://discuss.python.org/t/pdf-extraction-with-python-wrappers/40384>\
**Category:** Python Help\
**Created:** [December 5, 2023, 4:10pm UTC](https://discuss.python.org/t/pdf-extraction-with-python-wrappers/40384 "2023-12-05T16:10:21Z")\
**Posts on this page:** 1\
**Showing post:** 28

<div class="post-metadata">

**Author:** ![michaeldg\_94](https://avatars.discourse-cdn.com/v4/letter/m/d6d6ee/32.png) [@michaeldg\_94](https://discuss.python.org/u/michaeldg_94)\
**Post date:** [December 14, 2023, 7:48am UTC](https://discuss.python.org/t/pdf-extraction-with-python-wrappers/40384/28 "2023-12-14T07:48:39Z")

</div>

Hi @MRAB,

Thank you for your amazing code!  
I obtain the following error when trying to replicate your code:

```auto
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[16], line 443
    440 with open(tsv_path, "w", encoding="utf-8") as file:
    441 file.writelines(rows)
--> 443 App().mainloop()

Cell In[16], line 188, in App. __init__ (self)
    185 self.bind("<F12>", self.on_extract_page)
    186 self.bind("<Shift-F12>", self.on_extract_upto_page)
--> 188 self.config_path = splitext( __file__ )[0] + ".json"
    189 self.load_config()
    191 self.pdf_path = None

NameError: name ' __file__' is not defined

```

Could you give me any insight about that, please?  
Thank you in advance for your help!

---

_[View the full topic](https://discuss.python.org/t/pdf-extraction-with-python-wrappers/40384)._
