Python program generating a file path with
os.path.abspath(os.path.dirname(sys.argv[0]))
after creating variable
BAP_DATA_PATH = os.path.join(scriptdir, "BaptismTiltesTooPictures.xlsx")
when trying to use that as an argument in pandas read_excell
bap_pic_df = pd.read_excel(io=BAP_DATA_PATH)
returning FileNotFoundError
This is the file path generated
C:\\BaptismalSlideShow\\BaptismTiltesTooPictures.xlsx
When I remove the double backslash and paste into file explorer it does bring up the correct excel sheet
from pptx import Presentation
import datetime
import pandas as pd
import os
import sys
from collections import Counter
from pptx.util import Inches, Pt
from pptx.enum.shapes import MSO_SHAPE
from PIL import Image
from pptx.dml.color import RGBColor
import numpy as np
scriptdir = os.path.abspath(os.path.dirname(sys.argv[0]))
now = datetime.datetime.now()
TEST_FILE_PATH = os.path.join(scriptdir, "master.pptx")
BAP_DATA_PATH = os.path.join(scriptdir, "BaptismTiltesTooPictures.xlsx")
test_save = os.path.join(scriptdir, "Generated Baptismal Slide Show (Generated {}).pptx".format(now.strftime("%b %d, %Y at %I %M %S")))
WHEAT = os.path.join(scriptdir, "Wheat.jpg")
print ("test")
print (BAP_DATA_PATH)
bap_pic_df = pd.read_excel(io=BAP_DATA_PATH)
Tried manually putting in a string instead of the BAP_DATA_PATH variable, also did not work