简体   繁体   中英

How to get data from the docs folder in my github repository? It shows no directory when I tried deploying the application

在此处输入图片说明 I have added pdf files in the docs folder here

在此处输入图片说明

I need to add the path of the docs folder to my app.py file

在此处输入图片说明 When i add the path it show directory doesnt exist it . how do i correctly add the path to my my app.py file help please?

the problem seems to be with the path. You are trying to access files that are in the docs folder but have the path as guidenlines/docs/ .

Changing the code to look like this should solve your problem:

df = pdf_converter(directory_path="./docs/")

I would also suggest using the os module, it will allow for interoperability between different operating systems. A few links for your reference ( Link 1 , Link 2 ).

As for what I can observe right now, using the following code should suffice your use case:

import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))

docs_path = os.path.join(BASE_DIR, "docs")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM